diff options
author | Markus Armbruster <armbru@redhat.com> | 2022-12-21 14:35:49 +0100 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2023-01-20 07:24:28 +0100 |
commit | e2c1c34f139f49ef909bb4322607fb8b39002312 (patch) | |
tree | 7bd8fcb9db4dd89d8edcd3d59e8c5f42f2e5f445 /include/block | |
parent | 436956013539c19cf781ae333bc1c125d728cf1f (diff) | |
download | qemu-e2c1c34f139f49ef909bb4322607fb8b39002312.zip qemu-e2c1c34f139f49ef909bb4322607fb8b39002312.tar.gz qemu-e2c1c34f139f49ef909bb4322607fb8b39002312.tar.bz2 |
include/block: Untangle inclusion loops
We have two inclusion loops:
block/block.h
-> block/block-global-state.h
-> block/block-common.h
-> block/blockjob.h
-> block/block.h
block/block.h
-> block/block-io.h
-> block/block-common.h
-> block/blockjob.h
-> block/block.h
I believe these go back to Emanuele's reorganization of the block API,
merged a few months ago in commit d7e2fe4aac8.
Fortunately, breaking them is merely a matter of deleting unnecessary
includes from headers, and adding them back in places where they are
now missing.
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20221221133551.3967339-2-armbru@redhat.com>
Diffstat (limited to 'include/block')
-rw-r--r-- | include/block/block-common.h | 9 | ||||
-rw-r--r-- | include/block/block-copy.h | 4 | ||||
-rw-r--r-- | include/block/block-global-state.h | 4 | ||||
-rw-r--r-- | include/block/block-hmp-cmds.h | 2 | ||||
-rw-r--r-- | include/block/block-io.h | 5 | ||||
-rw-r--r-- | include/block/block.h | 4 | ||||
-rw-r--r-- | include/block/block_backup.h | 2 | ||||
-rw-r--r-- | include/block/block_int-common.h | 14 | ||||
-rw-r--r-- | include/block/block_int-global-state.h | 5 | ||||
-rw-r--r-- | include/block/block_int-io.h | 4 | ||||
-rw-r--r-- | include/block/block_int.h | 4 | ||||
-rw-r--r-- | include/block/blockjob.h | 2 | ||||
-rw-r--r-- | include/block/blockjob_int.h | 1 | ||||
-rw-r--r-- | include/block/dirty-bitmap.h | 1 | ||||
-rw-r--r-- | include/block/qapi.h | 2 | ||||
-rw-r--r-- | include/block/thread-pool.h | 2 | ||||
-rw-r--r-- | include/block/throttle-groups.h | 2 |
17 files changed, 35 insertions, 32 deletions
diff --git a/include/block/block-common.h b/include/block/block-common.h index 434ffc5..4168681 100644 --- a/include/block/block-common.h +++ b/include/block/block-common.h @@ -24,12 +24,8 @@ #ifndef BLOCK_COMMON_H #define BLOCK_COMMON_H -#include "block/aio.h" -#include "block/aio-wait.h" -#include "qemu/iov.h" -#include "block/accounting.h" -#include "qemu/hbitmap.h" -#include "qemu/transactions.h" +#include "qapi/qapi-types-block-core.h" +#include "qemu/queue.h" /* * co_wrapper{*}: Function specifiers used by block-coroutine-wrapper.py @@ -55,7 +51,6 @@ #define co_wrapper_bdrv_rdlock #define co_wrapper_mixed_bdrv_rdlock -#include "block/dirty-bitmap.h" #include "block/blockjob.h" /* block.c */ diff --git a/include/block/block-copy.h b/include/block/block-copy.h index 8cea4f9..d0f8386 100644 --- a/include/block/block-copy.h +++ b/include/block/block-copy.h @@ -15,8 +15,8 @@ #ifndef BLOCK_COPY_H #define BLOCK_COPY_H -#include "block/block.h" -#include "qemu/co-shared-resource.h" +#include "block/block-common.h" +#include "qemu/progress_meter.h" /* All APIs are thread-safe */ diff --git a/include/block/block-global-state.h b/include/block/block-global-state.h index b0a3cfe..a38f86d 100644 --- a/include/block/block-global-state.h +++ b/include/block/block-global-state.h @@ -24,7 +24,9 @@ #ifndef BLOCK_GLOBAL_STATE_H #define BLOCK_GLOBAL_STATE_H -#include "block-common.h" +#include "block/block-common.h" +#include "qemu/coroutine.h" +#include "qemu/transactions.h" /* * Global state (GS) API. These functions run under the BQL. diff --git a/include/block/block-hmp-cmds.h b/include/block/block-hmp-cmds.h index ba0593c..71113cd 100644 --- a/include/block/block-hmp-cmds.h +++ b/include/block/block-hmp-cmds.h @@ -15,6 +15,8 @@ #ifndef BLOCK_BLOCK_HMP_CMDS_H #define BLOCK_BLOCK_HMP_CMDS_H +#include "qemu/coroutine.h" + void hmp_drive_add(Monitor *mon, const QDict *qdict); void hmp_commit(Monitor *mon, const QDict *qdict); diff --git a/include/block/block-io.h b/include/block/block-io.h index 2ed6214..3398351 100644 --- a/include/block/block-io.h +++ b/include/block/block-io.h @@ -24,7 +24,10 @@ #ifndef BLOCK_IO_H #define BLOCK_IO_H -#include "block-common.h" +#include "block/aio-wait.h" +#include "block/block-common.h" +#include "qemu/coroutine.h" +#include "qemu/iov.h" /* * I/O API functions. These functions are thread-safe, and therefore diff --git a/include/block/block.h b/include/block/block.h index 1e6b8fe..e2c647d 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -24,8 +24,8 @@ #ifndef BLOCK_H #define BLOCK_H -#include "block-global-state.h" -#include "block-io.h" +#include "block/block-global-state.h" +#include "block/block-io.h" /* DO NOT ADD ANYTHING IN HERE. USE ONE OF THE HEADERS INCLUDED ABOVE */ diff --git a/include/block/block_backup.h b/include/block/block_backup.h index 157596c..4d4d5ba 100644 --- a/include/block/block_backup.h +++ b/include/block/block_backup.h @@ -18,7 +18,7 @@ #ifndef BLOCK_BACKUP_H #define BLOCK_BACKUP_H -#include "block/block_int.h" +#include "block/blockjob.h" void backup_do_checkpoint(BlockJob *job, Error **errp); diff --git a/include/block/block_int-common.h b/include/block/block_int-common.h index c34c525..887ace7 100644 --- a/include/block/block_int-common.h +++ b/include/block/block_int-common.h @@ -24,17 +24,13 @@ #ifndef BLOCK_INT_COMMON_H #define BLOCK_INT_COMMON_H -#include "block/accounting.h" -#include "block/block.h" -#include "block/aio-wait.h" -#include "qemu/queue.h" -#include "qemu/coroutine.h" -#include "qemu/stats64.h" -#include "qemu/timer.h" -#include "qemu/hbitmap.h" +#include "block/aio.h" +#include "block/block-common.h" +#include "block/block-global-state.h" #include "block/snapshot.h" -#include "qemu/throttle.h" +#include "qemu/iov.h" #include "qemu/rcu.h" +#include "qemu/stats64.h" #define BLOCK_FLAG_LAZY_REFCOUNTS 8 diff --git a/include/block/block_int-global-state.h b/include/block/block_int-global-state.h index 2f0993f..902406e 100644 --- a/include/block/block_int-global-state.h +++ b/include/block/block_int-global-state.h @@ -25,7 +25,10 @@ #ifndef BLOCK_INT_GLOBAL_STATE_H #define BLOCK_INT_GLOBAL_STATE_H -#include "block_int-common.h" +#include "block/blockjob.h" +#include "block/block_int-common.h" +#include "qemu/hbitmap.h" +#include "qemu/main-loop.h" /* * Global state (GS) API. These functions run under the BQL. diff --git a/include/block/block_int-io.h b/include/block/block_int-io.h index 8bc061e..4436721 100644 --- a/include/block/block_int-io.h +++ b/include/block/block_int-io.h @@ -24,7 +24,9 @@ #ifndef BLOCK_INT_IO_H #define BLOCK_INT_IO_H -#include "block_int-common.h" +#include "block/block_int-common.h" +#include "qemu/hbitmap.h" +#include "qemu/main-loop.h" /* * I/O API functions. These functions are thread-safe. diff --git a/include/block/block_int.h b/include/block/block_int.h index b35b013..567a178 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -24,8 +24,8 @@ #ifndef BLOCK_INT_H #define BLOCK_INT_H -#include "block_int-global-state.h" -#include "block_int-io.h" +#include "block/block_int-global-state.h" +#include "block/block_int-io.h" #include "block/graph-lock.h" /* DO NOT ADD ANYTHING IN HERE. USE ONE OF THE HEADERS INCLUDED ABOVE */ diff --git a/include/block/blockjob.h b/include/block/blockjob.h index 03032b2..058b0c8 100644 --- a/include/block/blockjob.h +++ b/include/block/blockjob.h @@ -26,8 +26,8 @@ #ifndef BLOCKJOB_H #define BLOCKJOB_H +#include "qapi/qapi-types-block-core.h" #include "qemu/job.h" -#include "block/block.h" #include "qemu/ratelimit.h" #define BLOCK_JOB_SLICE_TIME 100000000ULL /* ns */ diff --git a/include/block/blockjob_int.h b/include/block/blockjob_int.h index 6bd9ae2..f008446 100644 --- a/include/block/blockjob_int.h +++ b/include/block/blockjob_int.h @@ -27,7 +27,6 @@ #define BLOCKJOB_INT_H #include "block/blockjob.h" -#include "block/block.h" /** * BlockJobDriver: diff --git a/include/block/dirty-bitmap.h b/include/block/dirty-bitmap.h index c3700ce..233535e 100644 --- a/include/block/dirty-bitmap.h +++ b/include/block/dirty-bitmap.h @@ -1,6 +1,7 @@ #ifndef BLOCK_DIRTY_BITMAP_H #define BLOCK_DIRTY_BITMAP_H +#include "block/block-common.h" #include "qapi/qapi-types-block-core.h" #include "qemu/hbitmap.h" diff --git a/include/block/qapi.h b/include/block/qapi.h index 22c7807..865fb97 100644 --- a/include/block/qapi.h +++ b/include/block/qapi.h @@ -25,8 +25,8 @@ #ifndef BLOCK_QAPI_H #define BLOCK_QAPI_H -#include "block/block.h" #include "block/snapshot.h" +#include "qapi/qapi-types-block-core.h" BlockDeviceInfo *bdrv_block_device_info(BlockBackend *blk, BlockDriverState *bs, diff --git a/include/block/thread-pool.h b/include/block/thread-pool.h index 2020bcc..95ff2b0 100644 --- a/include/block/thread-pool.h +++ b/include/block/thread-pool.h @@ -18,7 +18,7 @@ #ifndef QEMU_THREAD_POOL_H #define QEMU_THREAD_POOL_H -#include "block/block.h" +#include "block/aio.h" #define THREAD_POOL_MAX_THREADS_DEFAULT 64 diff --git a/include/block/throttle-groups.h b/include/block/throttle-groups.h index 9541b32..ff282fc 100644 --- a/include/block/throttle-groups.h +++ b/include/block/throttle-groups.h @@ -25,8 +25,8 @@ #ifndef THROTTLE_GROUPS_H #define THROTTLE_GROUPS_H +#include "qemu/coroutine.h" #include "qemu/throttle.h" -#include "block/block_int.h" #include "qom/object.h" /* The ThrottleGroupMember structure indicates membership in a ThrottleGroup |