[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v10 7/9] stream: skip filters when writing backing file name to Q
From: |
Andrey Shinkevich |
Subject: |
[PATCH v10 7/9] stream: skip filters when writing backing file name to QCOW2 header |
Date: |
Tue, 29 Sep 2020 15:38:27 +0300 |
Avoid writing a filter JSON-name to QCOW2 image when the backing file
is changed after the block stream job.
Signed-off-by: Andrey Shinkevich <andrey.shinkevich@virtuozzo.com>
---
block/stream.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/block/stream.c b/block/stream.c
index e0540ee..b0719e9 100644
--- a/block/stream.c
+++ b/block/stream.c
@@ -65,6 +65,7 @@ static int stream_prepare(Job *job)
BlockDriverState *bs = blk_bs(bjob->blk);
BlockDriverState *unfiltered_bs = bdrv_skip_filters(bs);
BlockDriverState *base = bdrv_filter_or_cow_bs(s->above_base);
+ BlockDriverState *base_metadata = bdrv_skip_filters(base);
Error *local_err = NULL;
int ret = 0;
@@ -73,10 +74,10 @@ static int stream_prepare(Job *job)
if (bdrv_cow_child(unfiltered_bs)) {
const char *base_id = NULL, *base_fmt = NULL;
- if (base) {
- base_id = s->backing_file_str;
- if (base->drv) {
- base_fmt = base->drv->format_name;
+ if (base_metadata) {
+ base_id = base_metadata->filename;
+ if (base_metadata->drv) {
+ base_fmt = base_metadata->drv->format_name;
}
}
bdrv_set_backing_hd(unfiltered_bs, base, &local_err);
--
1.8.3.1
- [PATCH v10 0/9] Apply COR-filter to the block-stream permanently, Andrey Shinkevich, 2020/09/29
- [PATCH v10 1/9] copy-on-read: Support preadv/pwritev_part functions, Andrey Shinkevich, 2020/09/29
- [PATCH v10 2/9] copy-on-read: add filter append/drop functions, Andrey Shinkevich, 2020/09/29
- [PATCH v10 3/9] qapi: add filter-node-name to block-stream, Andrey Shinkevich, 2020/09/29
- [PATCH v10 4/9] copy-on-read: pass base node name to COR driver, Andrey Shinkevich, 2020/09/29
- [PATCH v10 5/9] copy-on-read: limit guest COR activity to base in COR driver, Andrey Shinkevich, 2020/09/29
- [PATCH v10 6/9] copy-on-read: skip non-guest reads if no copy needed, Andrey Shinkevich, 2020/09/29
- [PATCH v10 7/9] stream: skip filters when writing backing file name to QCOW2 header,
Andrey Shinkevich <=
- [PATCH v10 8/9] block: remove unused backing-file name parameter, Andrey Shinkevich, 2020/09/29
- [PATCH v10 9/9] block: apply COR-filter to block-stream jobs, Andrey Shinkevich, 2020/09/29