mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 07:43:54 -06:00
block/block-backend.c: assertions for block-backend
All the global state (GS) API functions will check that qemu_in_main_thread() returns true. If not, it means that the safety of BQL cannot be guaranteed, and they need to be moved to I/O. Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Message-Id: <20220303151616.325444-9-eesposit@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
a2c4c3b19b
commit
0439c5a462
2 changed files with 80 additions and 0 deletions
|
@ -971,6 +971,8 @@ BlockBackend *blk_by_qdev_id(const char *id, Error **errp)
|
|||
DeviceState *dev;
|
||||
BlockBackend *blk;
|
||||
|
||||
GLOBAL_STATE_CODE();
|
||||
|
||||
dev = find_device_state(id, errp);
|
||||
if (dev == NULL) {
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue