]> xenbits.xensource.com Git - qemu-xen.git/commitdiff
qcow2: Use QLIST_FOREACH_SAFE macro
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Thu, 15 Apr 2010 13:11:35 +0000 (14:11 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 23 Apr 2010 14:21:58 +0000 (16:21 +0200)
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/qcow2.c

index 30ded6ae9be146bb126c1529edaed162c4bdade7..f3e3cba71c560f0b3904ab28e09c4f72a90073e1 100644 (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);
     }