mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-11 03:24:58 -06:00
block: Use CAF in bdrv_co_rw_vmstate()
If a node whose driver does not provide VM state functions has a metadata child, the VM state should probably go there; if it is a filter, the VM state should probably go there. It follows that we should generally go down to the primary child. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com> Reviewed-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
52f72d6fb6
commit
c4db2e25df
1 changed files with 3 additions and 2 deletions
|
@ -2648,6 +2648,7 @@ bdrv_co_rw_vmstate(BlockDriverState *bs, QEMUIOVector *qiov, int64_t pos,
|
||||||
bool is_read)
|
bool is_read)
|
||||||
{
|
{
|
||||||
BlockDriver *drv = bs->drv;
|
BlockDriver *drv = bs->drv;
|
||||||
|
BlockDriverState *child_bs = bdrv_primary_bs(bs);
|
||||||
int ret = -ENOTSUP;
|
int ret = -ENOTSUP;
|
||||||
|
|
||||||
bdrv_inc_in_flight(bs);
|
bdrv_inc_in_flight(bs);
|
||||||
|
@ -2660,8 +2661,8 @@ bdrv_co_rw_vmstate(BlockDriverState *bs, QEMUIOVector *qiov, int64_t pos,
|
||||||
} else {
|
} else {
|
||||||
ret = drv->bdrv_save_vmstate(bs, qiov, pos);
|
ret = drv->bdrv_save_vmstate(bs, qiov, pos);
|
||||||
}
|
}
|
||||||
} else if (bs->file) {
|
} else if (child_bs) {
|
||||||
ret = bdrv_co_rw_vmstate(bs->file->bs, qiov, pos, is_read);
|
ret = bdrv_co_rw_vmstate(child_bs, qiov, pos, is_read);
|
||||||
}
|
}
|
||||||
|
|
||||||
bdrv_dec_in_flight(bs);
|
bdrv_dec_in_flight(bs);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue