On 4/12/25 10:25, Paolo Bonzini wrote:
On 12/4/25 09:35, Philippe Mathieu-Daudé wrote:
On 3/12/25 19:51, Paolo Bonzini wrote:
Avoid including all of qdev everywhere (the hw/core/qdev.h header in
fact
brings in a lot more headers too), instead declare a couple structs for
which only a pointer type is needed.
Signed-off-by: Paolo Bonzini <[email protected]>
---
include/block/aio.h | 7 +++----
include/block/block-copy.h | 1 +
include/block/block-global-state.h | 1 +
include/block/block-io.h | 1 +
include/block/dirty-bitmap.h | 1 +
include/hw/core/qdev.h | 6 +-----
include/qemu/job.h | 1 +
include/qemu/main-loop.h | 2 +-
include/qemu/mem-reentrancy.h | 10 ++++++++++
net/net.c | 1 +
util/async.c | 1 +
11 files changed, 22 insertions(+), 10 deletions(-)
create mode 100644 include/qemu/mem-reentrancy.h
diff --git a/include/block/aio.h b/include/block/aio.h
index 59c56d695ee..8cca2360d1a 100644
--- a/include/block/aio.h
+++ b/include/block/aio.h
@@ -23,9 +23,8 @@
#include "qemu/lockcnt.h"
#include "qemu/thread.h"
#include "qemu/timer.h"
-#include "block/graph-lock.h"
-#include "hw/core/qdev.h"
+struct MemReentrancyGuard;
typedef struct AioHandler AioHandler;
typedef QLIST_HEAD(, AioHandler) AioHandlerList;
@@ -211,7 +210,7 @@ struct AioContext {
* of nodes and edges from block graph while some
* other thread is traversing it.
*/
- BdrvGraphRWlock *bdrv_graph;
+ struct BdrvGraphRWlock *bdrv_graph;
/* The list of registered AIO handlers. Protected by ctx-
>list_lock. */
AioHandlerList aio_handlers;
@@ -393,7 +392,7 @@ void aio_bh_schedule_oneshot_full(AioContext
*ctx, QEMUBHFunc *cb, void *opaque,
* device-reentrancy issues
*/
QEMUBH *aio_bh_new_full(AioContext *ctx, QEMUBHFunc *cb, void *opaque,
- const char *name, MemReentrancyGuard
*reentrancy_guard);
+ const char *name, struct MemReentrancyGuard
*reentrancy_guard);
I suppose these changes were before you move the declarations to their
own "qemu/mem-reentrancy.h" header?
Yes, but also qemu/mem-reentrancy.h is not included here.
We want to also include it instead, right? (No need to forward declare)