aboutsummaryrefslogtreecommitdiff
path: root/block/qcow2.c
diff options
context:
space:
mode:
authorBlue Swirl <blauwirbel@gmail.com>2009-09-12 07:36:22 +0000
committerBlue Swirl <blauwirbel@gmail.com>2009-09-12 07:36:22 +0000
commit72cf2d4f0e181d0d3a3122e04129c58a95da713e (patch)
tree4d13c505a692104406090e94dd654fd1e98ec34e /block/qcow2.c
parent620150dc9c1827cdddfa64a0fada7af5f7ee405b (diff)
downloadqemu-72cf2d4f0e181d0d3a3122e04129c58a95da713e.zip
qemu-72cf2d4f0e181d0d3a3122e04129c58a95da713e.tar.gz
qemu-72cf2d4f0e181d0d3a3122e04129c58a95da713e.tar.bz2
Fix sys-queue.h conflict for good
Problem: Our file sys-queue.h is a copy of the BSD file, but there are some additions and it's not entirely compatible. Because of that, there have been conflicts with system headers on BSD systems. Some hacks have been introduced in the commits 15cc9235840a22c289edbe064a9b3c19c5f49896, f40d753718c72693c5f520f0d9899f6e50395e94, 96555a96d724016e13190b28cffa3bc929ac60dc and 3990d09adf4463eca200ad964cc55643c33feb50 but the fixes were fragile. Solution: Avoid the conflict entirely by renaming the functions and the file. Revert the previous hacks. Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'block/qcow2.c')
-rw-r--r--block/qcow2.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/block/qcow2.c b/block/qcow2.c
index 8579e01..a9e7682 100644
--- a/block/qcow2.c
+++ b/block/qcow2.c
@@ -219,7 +219,7 @@ static int qcow_open(BlockDriverState *bs, const char *filename, int flags)
if (qcow2_refcount_init(bs) < 0)
goto fail;
- LIST_INIT(&s->cluster_allocs);
+ QLIST_INIT(&s->cluster_allocs);
/* read qcow2 extensions */
if (header.backing_file_offset)
@@ -340,7 +340,7 @@ typedef struct QCowAIOCB {
QEMUIOVector hd_qiov;
QEMUBH *bh;
QCowL2Meta l2meta;
- LIST_ENTRY(QCowAIOCB) next_depend;
+ QLIST_ENTRY(QCowAIOCB) next_depend;
} QCowAIOCB;
static void qcow_aio_cancel(BlockDriverAIOCB *blockacb)
@@ -503,7 +503,7 @@ static QCowAIOCB *qcow_aio_setup(BlockDriverState *bs,
acb->n = 0;
acb->cluster_offset = 0;
acb->l2meta.nb_clusters = 0;
- LIST_INIT(&acb->l2meta.dependent_requests);
+ QLIST_INIT(&acb->l2meta.dependent_requests);
return acb;
}
@@ -530,12 +530,12 @@ static void run_dependent_requests(QCowL2Meta *m)
/* Take the request off the list of running requests */
if (m->nb_clusters != 0) {
- LIST_REMOVE(m, next_in_flight);
+ QLIST_REMOVE(m, next_in_flight);
}
/*
* Restart all dependent requests.
- * Can't use LIST_FOREACH here - the next link might not be the same
+ * 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)
*/
@@ -545,7 +545,7 @@ static void run_dependent_requests(QCowL2Meta *m)
}
/* Empty the list for the next part of the request */
- LIST_INIT(&m->dependent_requests);
+ QLIST_INIT(&m->dependent_requests);
}
static void qcow_aio_write_cb(void *opaque, int ret)
@@ -590,7 +590,7 @@ static void qcow_aio_write_cb(void *opaque, int ret)
/* Need to wait for another request? If so, we are done for now. */
if (!acb->cluster_offset && acb->l2meta.depends_on != NULL) {
- LIST_INSERT_HEAD(&acb->l2meta.depends_on->dependent_requests,
+ QLIST_INSERT_HEAD(&acb->l2meta.depends_on->dependent_requests,
acb, next_depend);
return;
}
@@ -690,7 +690,7 @@ static int preallocate(BlockDriverState *bs)
nb_sectors = bdrv_getlength(bs) >> 9;
offset = 0;
- LIST_INIT(&meta.dependent_requests);
+ QLIST_INIT(&meta.dependent_requests);
while (nb_sectors) {
num = MIN(nb_sectors, INT_MAX >> 9);