mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-20 16:42:04 -06:00
assertions for blockdev.h global state API
Signed-off-by: Emanuele Giuseppe Esposito <eesposit@redhat.com> Message-Id: <20220303151616.325444-22-eesposit@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
7569583124
commit
c5be7445b7
2 changed files with 19 additions and 0 deletions
|
@ -810,6 +810,7 @@ bool bdrv_is_root_node(BlockDriverState *bs)
|
|||
*/
|
||||
DriveInfo *blk_legacy_dinfo(BlockBackend *blk)
|
||||
{
|
||||
GLOBAL_STATE_CODE();
|
||||
return blk->legacy_dinfo;
|
||||
}
|
||||
|
||||
|
@ -821,6 +822,7 @@ DriveInfo *blk_legacy_dinfo(BlockBackend *blk)
|
|||
DriveInfo *blk_set_legacy_dinfo(BlockBackend *blk, DriveInfo *dinfo)
|
||||
{
|
||||
assert(!blk->legacy_dinfo);
|
||||
GLOBAL_STATE_CODE();
|
||||
return blk->legacy_dinfo = dinfo;
|
||||
}
|
||||
|
||||
|
@ -831,6 +833,7 @@ DriveInfo *blk_set_legacy_dinfo(BlockBackend *blk, DriveInfo *dinfo)
|
|||
BlockBackend *blk_by_legacy_dinfo(DriveInfo *dinfo)
|
||||
{
|
||||
BlockBackend *blk = NULL;
|
||||
GLOBAL_STATE_CODE();
|
||||
|
||||
while ((blk = blk_next(blk)) != NULL) {
|
||||
if (blk->legacy_dinfo == dinfo) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue