aboutsummaryrefslogtreecommitdiff
path: root/block.c
diff options
context:
space:
mode:
authorMax Reitz <mreitz@redhat.com>2019-02-01 20:29:07 +0100
committerMax Reitz <mreitz@redhat.com>2019-02-25 15:11:25 +0100
commitbb808d5f5c0978828a974d547e6032402c339555 (patch)
tree3decbcd4407305d8c5e66256cc21bfad8c3197d2 /block.c
parente24518e303e6a4372eba67a8bd3c8730a02b86f0 (diff)
downloadqemu-bb808d5f5c0978828a974d547e6032402c339555.zip
qemu-bb808d5f5c0978828a974d547e6032402c339555.tar.gz
qemu-bb808d5f5c0978828a974d547e6032402c339555.tar.bz2
block: Skip implicit nodes for filename info
bdrv_refresh_filename() should simply skip all implicit nodes. They are supposed to be invisible to the user, so they should not appear in filename information. Signed-off-by: Max Reitz <mreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Message-id: 20190201192935.18394-4-mreitz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/block.c b/block.c
index d97f5e7..31e4664 100644
--- a/block.c
+++ b/block.c
@@ -5549,6 +5549,20 @@ void bdrv_refresh_filename(BlockDriverState *bs)
bdrv_refresh_filename(child->bs);
}
+ if (bs->implicit) {
+ /* For implicit nodes, just copy everything from the single child */
+ child = QLIST_FIRST(&bs->children);
+ assert(QLIST_NEXT(child, next) == NULL);
+
+ pstrcpy(bs->exact_filename, sizeof(bs->exact_filename),
+ child->bs->exact_filename);
+ pstrcpy(bs->filename, sizeof(bs->filename), child->bs->filename);
+
+ bs->full_open_options = qobject_ref(child->bs->full_open_options);
+
+ return;
+ }
+
if (drv->bdrv_refresh_filename) {
/* Obsolete information is of no use here, so drop the old file name
* information before refreshing it */