[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v7 for-2.12 01/25] block/mirror: Small absolute-path
From: |
Max Reitz |
Subject: |
[Qemu-block] [PATCH v7 for-2.12 01/25] block/mirror: Small absolute-paths simplification |
Date: |
Mon, 20 Nov 2017 21:09:40 +0100 |
When invoking drive-mirror in absolute-paths mode, the target's backing
BDS is assigned to it in mirror_exit(). The current logic only does so
if the target does not have that backing BDS already; but it actually
cannot have a backing BDS at all (the BDS is opened with O_NO_BACKING in
qmp_drive_mirror()), so just assert that and assign the new backing BDS
unconditionally.
Signed-off-by: Max Reitz <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
---
block/mirror.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/block/mirror.c b/block/mirror.c
index 307b6391a8..f995924032 100644
--- a/block/mirror.c
+++ b/block/mirror.c
@@ -523,12 +523,12 @@ static void mirror_exit(BlockJob *job, void *opaque)
&error_abort);
if (s->backing_mode == MIRROR_SOURCE_BACKING_CHAIN) {
BlockDriverState *backing = s->is_none_mode ? src : s->base;
- if (backing_bs(target_bs) != backing) {
- bdrv_set_backing_hd(target_bs, backing, &local_err);
- if (local_err) {
- error_report_err(local_err);
- data->ret = -EPERM;
- }
+
+ assert(!target_bs->backing);
+ bdrv_set_backing_hd(target_bs, backing, &local_err);
+ if (local_err) {
+ error_report_err(local_err);
+ data->ret = -EPERM;
}
}
--
2.13.6
- [Qemu-block] [PATCH v7 for-2.12 00/25] block: Fix some filename generation issues, Max Reitz, 2017/11/20
- [Qemu-block] [PATCH v7 for-2.12 01/25] block/mirror: Small absolute-paths simplification,
Max Reitz <=
- [Qemu-block] [PATCH v7 for-2.12 02/25] block: Use children list in bdrv_refresh_filename, Max Reitz, 2017/11/20
- [Qemu-block] [PATCH v7 for-2.12 03/25] block: Add BDS.backing_overridden, Max Reitz, 2017/11/20
- [Qemu-block] [PATCH v7 for-2.12 04/25] iotests: Drop explicit base blockdev in 191, Max Reitz, 2017/11/20
- [Qemu-block] [PATCH v7 for-2.12 05/25] block: Respect backing bs in bdrv_refresh_filename, Max Reitz, 2017/11/20
- [Qemu-block] [PATCH v7 for-2.12 06/25] block: Make path_combine() return the path, Max Reitz, 2017/11/20
- [Qemu-block] [PATCH v7 for-2.12 07/25] block: bdrv_get_full_backing_filename_from_...'s ret. val., Max Reitz, 2017/11/20
- [Qemu-block] [PATCH v7 for-2.12 08/25] block: bdrv_get_full_backing_filename's ret. val., Max Reitz, 2017/11/20
- [Qemu-block] [PATCH v7 for-2.12 09/25] block: Add bdrv_make_absolute_filename(), Max Reitz, 2017/11/20
- [Qemu-block] [PATCH v7 for-2.12 10/25] block: Fix bdrv_find_backing_image(), Max Reitz, 2017/11/20
- [Qemu-block] [PATCH v7 for-2.12 11/25] block: Add bdrv_dirname(), Max Reitz, 2017/11/20