Revision 72cf2d4f block/qcow2.c

b/block/qcow2.c
219 219
    if (qcow2_refcount_init(bs) < 0)
220 220
        goto fail;
221 221

  
222
    LIST_INIT(&s->cluster_allocs);
222
    QLIST_INIT(&s->cluster_allocs);
223 223

  
224 224
    /* read qcow2 extensions */
225 225
    if (header.backing_file_offset)
......
340 340
    QEMUIOVector hd_qiov;
341 341
    QEMUBH *bh;
342 342
    QCowL2Meta l2meta;
343
    LIST_ENTRY(QCowAIOCB) next_depend;
343
    QLIST_ENTRY(QCowAIOCB) next_depend;
344 344
} QCowAIOCB;
345 345

  
346 346
static void qcow_aio_cancel(BlockDriverAIOCB *blockacb)
......
503 503
    acb->n = 0;
504 504
    acb->cluster_offset = 0;
505 505
    acb->l2meta.nb_clusters = 0;
506
    LIST_INIT(&acb->l2meta.dependent_requests);
506
    QLIST_INIT(&acb->l2meta.dependent_requests);
507 507
    return acb;
508 508
}
509 509

  
......
530 530

  
531 531
    /* Take the request off the list of running requests */
532 532
    if (m->nb_clusters != 0) {
533
        LIST_REMOVE(m, next_in_flight);
533
        QLIST_REMOVE(m, next_in_flight);
534 534
    }
535 535

  
536 536
    /*
537 537
     * Restart all dependent requests.
538
     * Can't use LIST_FOREACH here - the next link might not be the same
538
     * Can't use QLIST_FOREACH here - the next link might not be the same
539 539
     * any more after the callback  (request could depend on a different
540 540
     * request now)
541 541
     */
......
545 545
    }
546 546

  
547 547
    /* Empty the list for the next part of the request */
548
    LIST_INIT(&m->dependent_requests);
548
    QLIST_INIT(&m->dependent_requests);
549 549
}
550 550

  
551 551
static void qcow_aio_write_cb(void *opaque, int ret)
......
590 590

  
591 591
    /* Need to wait for another request? If so, we are done for now. */
592 592
    if (!acb->cluster_offset && acb->l2meta.depends_on != NULL) {
593
        LIST_INSERT_HEAD(&acb->l2meta.depends_on->dependent_requests,
593
        QLIST_INSERT_HEAD(&acb->l2meta.depends_on->dependent_requests,
594 594
            acb, next_depend);
595 595
        return;
596 596
    }
......
690 690

  
691 691
    nb_sectors = bdrv_getlength(bs) >> 9;
692 692
    offset = 0;
693
    LIST_INIT(&meta.dependent_requests);
693
    QLIST_INIT(&meta.dependent_requests);
694 694

  
695 695
    while (nb_sectors) {
696 696
        num = MIN(nb_sectors, INT_MAX >> 9);

Also available in: Unified diff