2 * BlockBackend RAM Registrar
4 * SPDX-License-Identifier: GPL-2.0-or-later
7 #ifndef BLOCK_RAM_REGISTRAR_H
8 #define BLOCK_RAM_REGISTRAR_H
10 #include "exec/ramlist.h"
13 * struct BlockRAMRegistrar:
15 * Keeps RAMBlock memory registered with a BlockBackend using
16 * blk_register_buf() including hotplugged memory.
18 * Emulated devices or other BlockBackend users initialize a BlockRAMRegistrar
19 * with blk_ram_registrar_init() before submitting I/O requests with the
20 * BDRV_REQ_REGISTERED_BUF flag set.
24 RAMBlockNotifier notifier
;
28 void blk_ram_registrar_init(BlockRAMRegistrar
*r
, BlockBackend
*blk
);
29 void blk_ram_registrar_destroy(BlockRAMRegistrar
*r
);
31 /* Have all RAMBlocks been registered successfully? */
32 static inline bool blk_ram_registrar_ok(BlockRAMRegistrar
*r
)
37 #endif /* BLOCK_RAM_REGISTRAR_H */