mirror of
https://github.com/qemu/qemu.git
synced 2026-02-04 02:24:51 +00:00
block: reduce files included by block/aio.h
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 <pbonzini@redhat.com>
This commit is contained in:
@@ -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);
|
||||
|
||||
/**
|
||||
* aio_bh_new: Allocate a new bottom half structure
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
#define BLOCK_COPY_H
|
||||
|
||||
#include "block/block-common.h"
|
||||
#include "block/graph-lock.h"
|
||||
#include "qemu/progress_meter.h"
|
||||
|
||||
/* All APIs are thread-safe */
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#define BLOCK_GLOBAL_STATE_H
|
||||
|
||||
#include "qemu/aiocb.h"
|
||||
#include "block/graph-lock.h"
|
||||
#include "block/block-common.h"
|
||||
#include "qemu/coroutine.h"
|
||||
#include "qemu/transactions.h"
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "qemu/aiocb.h"
|
||||
#include "block/aio-wait.h"
|
||||
#include "block/block-common.h"
|
||||
#include "block/graph-lock.h"
|
||||
#include "qemu/coroutine.h"
|
||||
#include "qemu/iov.h"
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define BLOCK_DIRTY_BITMAP_H
|
||||
|
||||
#include "block/block-common.h"
|
||||
#include "block/graph-lock.h"
|
||||
#include "qapi/qapi-types-block-core.h"
|
||||
#include "qemu/hbitmap.h"
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "qemu/atomic.h"
|
||||
#include "qemu/queue.h"
|
||||
#include "qemu/bitmap.h"
|
||||
#include "qemu/mem-reentrancy.h"
|
||||
#include "qemu/rcu.h"
|
||||
#include "qemu/rcu_queue.h"
|
||||
#include "qom/object.h"
|
||||
@@ -208,11 +209,6 @@ struct NamedClockList {
|
||||
QLIST_ENTRY(NamedClockList) node;
|
||||
};
|
||||
|
||||
typedef struct MemReentrancyGuard {
|
||||
bool engaged_in_io;
|
||||
} MemReentrancyGuard;
|
||||
|
||||
|
||||
typedef QLIST_HEAD(, NamedGPIOList) NamedGPIOListHead;
|
||||
typedef QLIST_HEAD(, NamedClockList) NamedClockListHead;
|
||||
typedef QLIST_HEAD(, BusState) BusStateHead;
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#include "qemu/progress_meter.h"
|
||||
#include "qemu/coroutine.h"
|
||||
#include "block/aio.h"
|
||||
#include "block/graph-lock.h"
|
||||
|
||||
typedef struct JobDriver JobDriver;
|
||||
typedef struct JobTxn JobTxn;
|
||||
|
||||
@@ -431,7 +431,7 @@ void qemu_cond_timedwait_bql(QemuCond *cond, int ms);
|
||||
#define qemu_bh_new(cb, opaque) \
|
||||
qemu_bh_new_full((cb), (opaque), (stringify(cb)), NULL)
|
||||
QEMUBH *qemu_bh_new_full(QEMUBHFunc *cb, void *opaque, const char *name,
|
||||
MemReentrancyGuard *reentrancy_guard);
|
||||
struct MemReentrancyGuard *reentrancy_guard);
|
||||
void qemu_bh_schedule_idle(QEMUBH *bh);
|
||||
|
||||
enum {
|
||||
|
||||
10
include/qemu/mem-reentrancy.h
Normal file
10
include/qemu/mem-reentrancy.h
Normal file
@@ -0,0 +1,10 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
||||
|
||||
#ifndef QEMU_MEM_REENTRANCY_H
|
||||
#define QEMU_MEM_REENTRANCY_H 1
|
||||
|
||||
typedef struct MemReentrancyGuard {
|
||||
bool engaged_in_io;
|
||||
} MemReentrancyGuard;
|
||||
|
||||
#endif
|
||||
@@ -39,6 +39,7 @@
|
||||
#include "qobject/qdict.h"
|
||||
#include "qapi/qmp/qerror.h"
|
||||
#include "qemu/error-report.h"
|
||||
#include "qemu/mem-reentrancy.h"
|
||||
#include "qemu/sockets.h"
|
||||
#include "qemu/cutils.h"
|
||||
#include "qemu/config-file.h"
|
||||
|
||||
@@ -108,7 +108,7 @@ int64_t qemu_clock_deadline_ns_all(QEMUClockType type, int attr_mask)
|
||||
}
|
||||
|
||||
QEMUBH *qemu_bh_new_full(QEMUBHFunc *cb, void *opaque, const char *name,
|
||||
MemReentrancyGuard *reentrancy_guard)
|
||||
struct MemReentrancyGuard *reentrancy_guard)
|
||||
{
|
||||
QEMUBH *bh = g_new(QEMUBH, 1);
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "block/thread-pool.h"
|
||||
#include "block/graph-lock.h"
|
||||
#include "qemu/main-loop.h"
|
||||
#include "qemu/mem-reentrancy.h"
|
||||
#include "qemu/atomic.h"
|
||||
#include "qemu/lockcnt.h"
|
||||
#include "qemu/rcu_queue.h"
|
||||
|
||||
Reference in New Issue
Block a user