From: Andrey Shinkevich via <qemu-devel@nongnu.org>
To: qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, kwolf@redhat.com, mreitz@redhat.com,
stefanha@redhat.com, fam@euphon.net, jsnow@redhat.com,
armbru@redhat.com, eblake@redhat.com, den@openvz.org,
vsementsov@virtuozzo.com, andrey.shinkevich@virtuozzo.com
Subject: [PATCH v9 7/9] stream: skip filters when writing backing file name to QCOW2 header
Date: Mon, 28 Sep 2020 15:59:59 +0300 [thread overview]
Message-ID: <1601298001-774096-8-git-send-email-andrey.shinkevich@virtuozzo.com> (raw)
In-Reply-To: <1601298001-774096-1-git-send-email-andrey.shinkevich@virtuozzo.com>
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
next prev parent reply other threads:[~2020-09-28 13:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-28 12:59 [PATCH v9 0/9] Apply COR-filter to the block-stream permanently Andrey Shinkevich via
2020-09-28 12:59 ` [PATCH v9 1/9] copy-on-read: Support preadv/pwritev_part functions Andrey Shinkevich via
2020-09-28 12:59 ` [PATCH v9 2/9] copy-on-read: add filter append/drop functions Andrey Shinkevich via
2020-09-28 12:59 ` [PATCH v9 3/9] qapi: add filter-node-name to block-stream Andrey Shinkevich via
2020-09-28 12:59 ` [PATCH v9 4/9] copy-on-read: pass base node name to COR driver Andrey Shinkevich via
2020-09-28 12:59 ` [PATCH v9 5/9] copy-on-read: limit guest COR activity to base in " Andrey Shinkevich via
2020-09-28 12:59 ` [PATCH v9 6/9] copy-on-read: skip non-guest reads if no copy needed Andrey Shinkevich via
2020-09-28 12:59 ` Andrey Shinkevich via [this message]
2020-09-28 13:00 ` [PATCH v9 8/9] block: remove unused backing-file name parameter Andrey Shinkevich via
2020-09-28 13:00 ` [PATCH v9 9/9] block: apply COR-filter to block-stream jobs Andrey Shinkevich via
2020-09-28 20:33 ` [PATCH v9 0/9] Apply COR-filter to the block-stream permanently no-reply
2020-09-28 20:37 ` no-reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1601298001-774096-8-git-send-email-andrey.shinkevich@virtuozzo.com \
--to=qemu-devel@nongnu.org \
--cc=andrey.shinkevich@virtuozzo.com \
--cc=armbru@redhat.com \
--cc=den@openvz.org \
--cc=eblake@redhat.com \
--cc=fam@euphon.net \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=stefanha@redhat.com \
--cc=vsementsov@virtuozzo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).