[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v6 19/42] block: Use CAF in bdrv_co_rw_vmstate()
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH v6 19/42] block: Use CAF in bdrv_co_rw_vmstate() |
Date: |
Fri, 9 Aug 2019 18:13:44 +0200 |
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 <address@hidden>
Reviewed-by: Vladimir Sementsov-Ogievskiy <address@hidden>
---
block/io.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/block/io.c b/block/io.c
index dca4689b2f..e222d91893 100644
--- a/block/io.c
+++ b/block/io.c
@@ -2434,6 +2434,7 @@ bdrv_co_rw_vmstate(BlockDriverState *bs, QEMUIOVector
*qiov, int64_t pos,
bool is_read)
{
BlockDriver *drv = bs->drv;
+ BlockDriverState *child_bs = bdrv_primary_bs(bs);
int ret = -ENOTSUP;
bdrv_inc_in_flight(bs);
@@ -2446,8 +2447,8 @@ bdrv_co_rw_vmstate(BlockDriverState *bs, QEMUIOVector
*qiov, int64_t pos,
} else {
ret = drv->bdrv_save_vmstate(bs, qiov, pos);
}
- } else if (bs->file) {
- ret = bdrv_co_rw_vmstate(bs->file->bs, qiov, pos, is_read);
+ } else if (child_bs) {
+ ret = bdrv_co_rw_vmstate(child_bs, qiov, pos, is_read);
}
bdrv_dec_in_flight(bs);
--
2.21.0
- [Qemu-devel] [PATCH v6 14/42] block: Use CAFs when working with backing chains, (continued)
- [Qemu-devel] [PATCH v6 14/42] block: Use CAFs when working with backing chains, Max Reitz, 2019/08/09
- [Qemu-devel] [PATCH v6 15/42] block: Re-evaluate backing file handling in reopen, Max Reitz, 2019/08/09
- [Qemu-devel] [PATCH v6 16/42] block: Flush all children in generic code, Max Reitz, 2019/08/09
- [Qemu-devel] [PATCH v6 17/42] block: Use CAFs in bdrv_refresh_limits(), Max Reitz, 2019/08/09
- [Qemu-devel] [PATCH v6 18/42] block: Use CAFs in bdrv_refresh_filename(), Max Reitz, 2019/08/09
- [Qemu-devel] [PATCH v6 19/42] block: Use CAF in bdrv_co_rw_vmstate(),
Max Reitz <=
- [Qemu-devel] [PATCH v6 20/42] block/snapshot: Fix fallback, Max Reitz, 2019/08/09
- [Qemu-devel] [PATCH v6 21/42] block: Use CAFs for debug breakpoints, Max Reitz, 2019/08/09
- [Qemu-devel] [PATCH v6 22/42] block: Fix bdrv_get_allocated_file_size's fallback, Max Reitz, 2019/08/09
[Qemu-devel] [PATCH v6 23/42] blockdev: Use CAF in external_snapshot_prepare(), Max Reitz, 2019/08/09