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 15cc923584,
f40d753718,
96555a96d7 and
3990d09adf 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>
This commit is contained in:
Blue Swirl 2009-09-12 07:36:22 +00:00
parent 620150dc9c
commit 72cf2d4f0e
65 changed files with 481 additions and 488 deletions

View file

@ -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);