From: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
To: qemu-devel@nongnu.org, qemu-block@nongnu.org
Cc: fam@euphon.net, kwolf@redhat.com, vsementsov@virtuozzo.com,
mreitz@redhat.com, stefanha@redhat.com, den@openvz.org,
jsnow@redhat.com
Subject: [Qemu-devel] [PATCH v8 3/7] block: allow not one child for implicit node
Date: Wed, 29 May 2019 18:46:50 +0300 [thread overview]
Message-ID: <20190529154654.95870-4-vsementsov@virtuozzo.com> (raw)
In-Reply-To: <20190529154654.95870-1-vsementsov@virtuozzo.com>
Upcoming backup-top filter wants to operate like usual implicit filter
node with fall-through to backing child. But also needs additional
target child, let's support that.
On the other hand, after backup completion (before job dismiss) filter
is still attached to job blk, but don't have any children. Support this
too.
Signed-off-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
---
block.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/block.c b/block.c
index 57216f4115..3f4de3ae32 100644
--- a/block.c
+++ b/block.c
@@ -6200,9 +6200,20 @@ void bdrv_refresh_filename(BlockDriverState *bs)
}
if (bs->implicit) {
- /* For implicit nodes, just copy everything from the single child */
+ /*
+ * For implicit nodes, just copy everything from the single child or
+ * from backing, if there are several children.
+ * If there are no children for some reason (filter is still attached
+ * to block-job blk, but already removed from backing chain of device)
+ * do nothing.
+ */
child = QLIST_FIRST(&bs->children);
- assert(QLIST_NEXT(child, next) == NULL);
+ if (!child) {
+ return;
+ } else if (QLIST_NEXT(child, next)) {
+ assert(bs->backing);
+ child = bs->backing;
+ }
pstrcpy(bs->exact_filename, sizeof(bs->exact_filename),
child->bs->exact_filename);
--
2.18.0
next prev parent reply other threads:[~2019-05-29 15:49 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-29 15:46 [Qemu-devel] [PATCH v8 0/7] backup-top filter driver for backup Vladimir Sementsov-Ogievskiy
2019-05-29 15:46 ` [Qemu-devel] [PATCH v8 1/7] block: teach bdrv_debug_breakpoint skip filters with backing Vladimir Sementsov-Ogievskiy
2019-06-13 13:43 ` Max Reitz
2019-05-29 15:46 ` [Qemu-devel] [PATCH v8 2/7] block: swap operation order in bdrv_append Vladimir Sementsov-Ogievskiy
2019-06-13 13:45 ` Max Reitz
2019-06-13 14:02 ` Vladimir Sementsov-Ogievskiy
2019-05-29 15:46 ` Vladimir Sementsov-Ogievskiy [this message]
2019-06-13 13:51 ` [Qemu-devel] [PATCH v8 3/7] block: allow not one child for implicit node Max Reitz
2019-05-29 15:46 ` [Qemu-devel] [PATCH v8 4/7] block: introduce backup-top filter driver Vladimir Sementsov-Ogievskiy
2019-06-13 15:57 ` Max Reitz
2019-06-14 9:04 ` Vladimir Sementsov-Ogievskiy
2019-06-14 12:57 ` Max Reitz
2019-06-14 16:22 ` Vladimir Sementsov-Ogievskiy
2019-06-14 20:03 ` Max Reitz
2019-06-17 10:36 ` Vladimir Sementsov-Ogievskiy
2019-06-17 14:56 ` Max Reitz
2019-06-17 15:53 ` Kevin Wolf
2019-06-17 16:01 ` Max Reitz
2019-06-17 16:25 ` Kevin Wolf
2019-06-18 7:19 ` Vladimir Sementsov-Ogievskiy
2019-06-18 8:20 ` Kevin Wolf
2019-06-18 8:29 ` Vladimir Sementsov-Ogievskiy
2019-06-18 7:25 ` Vladimir Sementsov-Ogievskiy
2019-05-29 15:46 ` [Qemu-devel] [PATCH v8 5/7] block/io: refactor wait_serialising_requests Vladimir Sementsov-Ogievskiy
2019-05-29 15:46 ` [Qemu-devel] [PATCH v8 6/7] block: add lock/unlock range functions Vladimir Sementsov-Ogievskiy
2019-06-13 16:31 ` Max Reitz
2019-05-29 15:46 ` [Qemu-devel] [PATCH v8 7/7] block/backup: use backup-top instead of write notifiers Vladimir Sementsov-Ogievskiy
2019-06-13 18:02 ` Max Reitz
2019-06-14 9:14 ` Vladimir Sementsov-Ogievskiy
2019-05-30 13:25 ` [Qemu-devel] [PATCH v8 0/7] backup-top filter driver for backup Vladimir Sementsov-Ogievskiy
2019-06-13 16:08 ` no-reply
2019-06-13 16:41 ` 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=20190529154654.95870-4-vsementsov@virtuozzo.com \
--to=vsementsov@virtuozzo.com \
--cc=den@openvz.org \
--cc=fam@euphon.net \
--cc=jsnow@redhat.com \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.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).