[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 11/12] mirror: Implement .bdrv_refresh_filename
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PULL 11/12] mirror: Implement .bdrv_refresh_filename |
Date: |
Mon, 13 Mar 2017 15:55:07 +0100 |
We want query-block to return the right filename, even if a mirror job
put a bdrv_mirror_top on top of the actual image format driver. Let
bdrv_mirror_top.bdrv_refresh_filename get the filename from its backing
file.
Signed-off-by: Kevin Wolf <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
---
block/mirror.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/block/mirror.c b/block/mirror.c
index a5d30ee..4f3a5cb 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -12,6 +12,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/cutils.h"
#include "trace.h"
#include "block/blockjob_int.h"
#include "block/block_int.h"
@@ -1060,6 +1061,13 @@ static int coroutine_fn
bdrv_mirror_top_pdiscard(BlockDriverState *bs,
return bdrv_co_pdiscard(bs->backing->bs, offset, count);
}
+static void bdrv_mirror_top_refresh_filename(BlockDriverState *bs, QDict *opts)
+{
+ bdrv_refresh_filename(bs->backing->bs);
+ pstrcpy(bs->exact_filename, sizeof(bs->exact_filename),
+ bs->backing->bs->filename);
+}
+
static void bdrv_mirror_top_close(BlockDriverState *bs)
{
}
@@ -1088,6 +1096,7 @@ static BlockDriver bdrv_mirror_top = {
.bdrv_co_pdiscard = bdrv_mirror_top_pdiscard,
.bdrv_co_flush = bdrv_mirror_top_flush,
.bdrv_co_get_block_status = bdrv_mirror_top_get_block_status,
+ .bdrv_refresh_filename = bdrv_mirror_top_refresh_filename,
.bdrv_close = bdrv_mirror_top_close,
.bdrv_child_perm = bdrv_mirror_top_child_perm,
};
--
1.8.3.1
- [Qemu-devel] [PULL 00/12] Block layer fixes for 2.9.0-rc1, Kevin Wolf, 2017/03/13
- [Qemu-devel] [PULL 01/12] backup: allow target without .bdrv_get_info, Kevin Wolf, 2017/03/13
- [Qemu-devel] [PULL 02/12] file-posix: Consider max_segments for BlockLimits.max_transfer, Kevin Wolf, 2017/03/13
- [Qemu-devel] [PULL 04/12] backup: React to bdrv_is_allocated() errors, Kevin Wolf, 2017/03/13
- [Qemu-devel] [PULL 05/12] vvfat: React to bdrv_is_allocated() errors, Kevin Wolf, 2017/03/13
- [Qemu-devel] [PULL 06/12] migration: Document handling of bdrv_is_allocated() errors, Kevin Wolf, 2017/03/13
- [Qemu-devel] [PULL 07/12] block: Remove check_new_perm from bdrv_replace_child(), Kevin Wolf, 2017/03/13
- [Qemu-devel] [PULL 10/12] block: Refresh filename after changing backing file, Kevin Wolf, 2017/03/13
- [Qemu-devel] [PULL 12/12] commit: Implement .bdrv_refresh_filename, Kevin Wolf, 2017/03/13
- [Qemu-devel] [PULL 11/12] mirror: Implement .bdrv_refresh_filename,
Kevin Wolf <=
- [Qemu-devel] [PULL 08/12] block: Request block status from *file for BDRV_BLOCK_RAW, Kevin Wolf, 2017/03/13
- [Qemu-devel] [PULL 09/12] commit: Implement bdrv_commit_top.bdrv_co_get_block_status, Kevin Wolf, 2017/03/13
- [Qemu-devel] [PULL 03/12] block: Drop unmaintained 'archipelago' driver, Kevin Wolf, 2017/03/13
- Re: [Qemu-devel] [PULL 00/12] Block layer fixes for 2.9.0-rc1, Peter Maydell, 2017/03/13