diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2018-12-06 11:58:10 +0100 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2019-01-11 15:46:55 +0100 |
commit | b58deb344ddff3b9d8b265bf73a65274767ee5f4 (patch) | |
tree | b311a114fbe0b2bfcd7d5b2001f7db3699f6fa6a /block | |
parent | 10ca76b4d2075154b3d3e0ea3ab3dd17da71b11c (diff) |
qemu/queue.h: leave head structs anonymous unless necessary
Most list head structs need not be given a name. In most cases the
name is given just in case one is going to use QTAILQ_LAST, QTAILQ_PREV
or reverse iteration, but this does not apply to lists of other kinds,
and even for QTAILQ in practice this is only rarely needed. In addition,
we will soon reimplement those macros completely so that they do not
need a name for the head struct. So clean up everything, not giving a
name except in the rare case where it is necessary.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'block')
-rw-r--r-- | block/gluster.c | 2 | ||||
-rw-r--r-- | block/mirror.c | 2 | ||||
-rw-r--r-- | block/qcow2-bitmap.c | 4 | ||||
-rw-r--r-- | block/qcow2.h | 5 | ||||
-rw-r--r-- | block/sheepdog.c | 6 | ||||
-rw-r--r-- | block/vhdx.h | 2 |
6 files changed, 11 insertions, 10 deletions
diff --git a/block/gluster.c b/block/gluster.c index 5e300c96c8..72891060e3 100644 --- a/block/gluster.c +++ b/block/gluster.c @@ -72,7 +72,7 @@ typedef struct ListElement { GlfsPreopened saved; } ListElement; -static QLIST_HEAD(glfs_list, ListElement) glfs_list; +static QLIST_HEAD(, ListElement) glfs_list; static QemuOptsList qemu_gluster_create_opts = { .name = "qemu-gluster-create-opts", diff --git a/block/mirror.c b/block/mirror.c index ab59ad77e8..f0b211a9c8 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -72,7 +72,7 @@ typedef struct MirrorBlockJob { unsigned long *in_flight_bitmap; int in_flight; int64_t bytes_in_flight; - QTAILQ_HEAD(MirrorOpList, MirrorOp) ops_in_flight; + QTAILQ_HEAD(, MirrorOp) ops_in_flight; int ret; bool unmap; int target_cluster_size; diff --git a/block/qcow2-bitmap.c b/block/qcow2-bitmap.c index accebef4cf..b946301429 100644 --- a/block/qcow2-bitmap.c +++ b/block/qcow2-bitmap.c @@ -77,8 +77,6 @@ typedef struct Qcow2BitmapTable { uint32_t size; /* number of 64bit entries */ QSIMPLEQ_ENTRY(Qcow2BitmapTable) entry; } Qcow2BitmapTable; -typedef QSIMPLEQ_HEAD(Qcow2BitmapTableList, Qcow2BitmapTable) - Qcow2BitmapTableList; typedef struct Qcow2Bitmap { Qcow2BitmapTable table; @@ -1316,7 +1314,7 @@ void qcow2_store_persistent_dirty_bitmaps(BlockDriverState *bs, Error **errp) int ret; Qcow2BitmapList *bm_list; Qcow2Bitmap *bm; - Qcow2BitmapTableList drop_tables; + QSIMPLEQ_HEAD(, Qcow2BitmapTable) drop_tables; Qcow2BitmapTable *tb, *tb_next; if (!bdrv_has_changed_persistent_bitmaps(bs)) { diff --git a/block/qcow2.h b/block/qcow2.h index a98d24500b..438a1dee9e 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -278,7 +278,10 @@ typedef struct BDRVQcow2State { QEMUTimer *cache_clean_timer; unsigned cache_clean_interval; - QLIST_HEAD(QCowClusterAlloc, QCowL2Meta) cluster_allocs; + uint8_t *cluster_cache; + uint8_t *cluster_data; + uint64_t cluster_cache_offset; + QLIST_HEAD(, QCowL2Meta) cluster_allocs; uint64_t *refcount_table; uint64_t refcount_table_offset; diff --git a/block/sheepdog.c b/block/sheepdog.c index 0125df9d49..90ab43baa4 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -391,12 +391,12 @@ struct BDRVSheepdogState { uint32_t aioreq_seq_num; /* Every aio request must be linked to either of these queues. */ - QLIST_HEAD(inflight_aio_head, AIOReq) inflight_aio_head; - QLIST_HEAD(failed_aio_head, AIOReq) failed_aio_head; + QLIST_HEAD(, AIOReq) inflight_aio_head; + QLIST_HEAD(, AIOReq) failed_aio_head; CoMutex queue_lock; CoQueue overlapping_queue; - QLIST_HEAD(inflight_aiocb_head, SheepdogAIOCB) inflight_aiocb_head; + QLIST_HEAD(, SheepdogAIOCB) inflight_aiocb_head; }; typedef struct BDRVSheepdogReopenState { diff --git a/block/vhdx.h b/block/vhdx.h index 3a5f5293ad..1bfb4e4f73 100644 --- a/block/vhdx.h +++ b/block/vhdx.h @@ -398,7 +398,7 @@ typedef struct BDRVVHDXState { bool log_replayed_on_open; - QLIST_HEAD(VHDXRegionHead, VHDXRegionEntry) regions; + QLIST_HEAD(, VHDXRegionEntry) regions; } BDRVVHDXState; void vhdx_guid_generate(MSGUID *guid); |