aboutsummaryrefslogtreecommitdiff
path: root/hw/xen_disk.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 /hw/xen_disk.c
parent620150dc9c1827cdddfa64a0fada7af5f7ee405b (diff)
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 'hw/xen_disk.c')
-rw-r--r--hw/xen_disk.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/hw/xen_disk.c b/hw/xen_disk.c
index 100ef8e9bc..74cde80691 100644
--- a/hw/xen_disk.c
+++ b/hw/xen_disk.c
@@ -77,7 +77,7 @@ struct ioreq {
int aio_errors;
struct XenBlkDev *blkdev;
- LIST_ENTRY(ioreq) list;
+ QLIST_ENTRY(ioreq) list;
};
struct XenBlkDev {
@@ -99,9 +99,9 @@ struct XenBlkDev {
int cnt_map;
/* request lists */
- LIST_HEAD(inflight_head, ioreq) inflight;
- LIST_HEAD(finished_head, ioreq) finished;
- LIST_HEAD(freelist_head, ioreq) freelist;
+ QLIST_HEAD(inflight_head, ioreq) inflight;
+ QLIST_HEAD(finished_head, ioreq) finished;
+ QLIST_HEAD(freelist_head, ioreq) freelist;
int requests_total;
int requests_inflight;
int requests_finished;
@@ -118,7 +118,7 @@ static struct ioreq *ioreq_start(struct XenBlkDev *blkdev)
{
struct ioreq *ioreq = NULL;
- if (LIST_EMPTY(&blkdev->freelist)) {
+ if (QLIST_EMPTY(&blkdev->freelist)) {
if (blkdev->requests_total >= max_requests)
goto out;
/* allocate new struct */
@@ -128,11 +128,11 @@ static struct ioreq *ioreq_start(struct XenBlkDev *blkdev)
qemu_iovec_init(&ioreq->v, BLKIF_MAX_SEGMENTS_PER_REQUEST);
} else {
/* get one from freelist */
- ioreq = LIST_FIRST(&blkdev->freelist);
- LIST_REMOVE(ioreq, list);
+ ioreq = QLIST_FIRST(&blkdev->freelist);
+ QLIST_REMOVE(ioreq, list);
qemu_iovec_reset(&ioreq->v);
}
- LIST_INSERT_HEAD(&blkdev->inflight, ioreq, list);
+ QLIST_INSERT_HEAD(&blkdev->inflight, ioreq, list);
blkdev->requests_inflight++;
out:
@@ -143,8 +143,8 @@ static void ioreq_finish(struct ioreq *ioreq)
{
struct XenBlkDev *blkdev = ioreq->blkdev;
- LIST_REMOVE(ioreq, list);
- LIST_INSERT_HEAD(&blkdev->finished, ioreq, list);
+ QLIST_REMOVE(ioreq, list);
+ QLIST_INSERT_HEAD(&blkdev->finished, ioreq, list);
blkdev->requests_inflight--;
blkdev->requests_finished++;
}
@@ -153,10 +153,10 @@ static void ioreq_release(struct ioreq *ioreq)
{
struct XenBlkDev *blkdev = ioreq->blkdev;
- LIST_REMOVE(ioreq, list);
+ QLIST_REMOVE(ioreq, list);
memset(ioreq, 0, sizeof(*ioreq));
ioreq->blkdev = blkdev;
- LIST_INSERT_HEAD(&blkdev->freelist, ioreq, list);
+ QLIST_INSERT_HEAD(&blkdev->freelist, ioreq, list);
blkdev->requests_finished--;
}
@@ -476,8 +476,8 @@ static void blk_send_response_all(struct XenBlkDev *blkdev)
struct ioreq *ioreq;
int send_notify = 0;
- while (!LIST_EMPTY(&blkdev->finished)) {
- ioreq = LIST_FIRST(&blkdev->finished);
+ while (!QLIST_EMPTY(&blkdev->finished)) {
+ ioreq = QLIST_FIRST(&blkdev->finished);
send_notify += blk_send_response_one(ioreq);
ioreq_release(ioreq);
}
@@ -564,9 +564,9 @@ static void blk_alloc(struct XenDevice *xendev)
{
struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev);
- LIST_INIT(&blkdev->inflight);
- LIST_INIT(&blkdev->finished);
- LIST_INIT(&blkdev->freelist);
+ QLIST_INIT(&blkdev->inflight);
+ QLIST_INIT(&blkdev->finished);
+ QLIST_INIT(&blkdev->freelist);
blkdev->bh = qemu_bh_new(blk_bh, blkdev);
if (xen_mode != XEN_EMULATE)
batch_maps = 1;
@@ -750,9 +750,9 @@ static int blk_free(struct XenDevice *xendev)
struct XenBlkDev *blkdev = container_of(xendev, struct XenBlkDev, xendev);
struct ioreq *ioreq;
- while (!LIST_EMPTY(&blkdev->freelist)) {
- ioreq = LIST_FIRST(&blkdev->freelist);
- LIST_REMOVE(ioreq, list);
+ while (!QLIST_EMPTY(&blkdev->freelist)) {
+ ioreq = QLIST_FIRST(&blkdev->freelist);
+ QLIST_REMOVE(ioreq, list);
qemu_iovec_destroy(&ioreq->v);
qemu_free(ioreq);
}