qcow2: Use QLIST_FOREACH_SAFE macro

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
Stefan Hajnoczi 2010-04-15 14:11:35 +01:00 committed by Kevin Wolf
parent 2be5064953
commit d4c146f0da
1 changed files with 2 additions and 8 deletions

View File

@ -539,14 +539,8 @@ static void run_dependent_requests(QCowL2Meta *m)
QLIST_REMOVE(m, next_in_flight);
}
/*
* Restart all dependent requests.
* Can't use QLIST_FOREACH here - the next link might not be the same
* any more after the callback (request could depend on a different
* request now)
*/
for (req = m->dependent_requests.lh_first; req != NULL; req = next) {
next = req->next_depend.le_next;
/* Restart all dependent requests */
QLIST_FOREACH_SAFE(req, &m->dependent_requests, next_depend, next) {
qcow_aio_write_cb(req, 0);
}