[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v11 03/31] block: Skip implicit nodes for filename i
From: |
Max Reitz |
Subject: |
[Qemu-devel] [PATCH v11 03/31] block: Skip implicit nodes for filename info |
Date: |
Sat, 6 Oct 2018 01:39:55 +0200 |
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 <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Alberto Garcia <address@hidden>
---
block.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/block.c b/block.c
index fd5e18081a..4bbb278659 100644
--- a/block.c
+++ b/block.c
@@ -5237,6 +5237,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 */
--
2.17.1
- [Qemu-devel] [PATCH v11 25/31] block: Do not copy exact_filename from format file, (continued)
- [Qemu-devel] [PATCH v11 25/31] block: Do not copy exact_filename from format file, Max Reitz, 2018/10/05
- [Qemu-devel] [PATCH v11 26/31] block/nvme: Fix bdrv_refresh_filename(), Max Reitz, 2018/10/05
- [Qemu-devel] [PATCH v11 24/31] block: Purify .bdrv_refresh_filename(), Max Reitz, 2018/10/05
- [Qemu-devel] [PATCH v11 27/31] block/curl: Harmonize option defaults, Max Reitz, 2018/10/05
- [Qemu-devel] [PATCH v11 29/31] block/null: Generate filename even with latency-ns, Max Reitz, 2018/10/05
- [Qemu-devel] [PATCH v11 28/31] block/curl: Implement bdrv_refresh_filename(), Max Reitz, 2018/10/05
- [Qemu-devel] [PATCH v11 30/31] block: BDS options may lack the "driver" option, Max Reitz, 2018/10/05
- [Qemu-devel] [PATCH v11 31/31] iotests: Test json:{} filenames of internal BDSs, Max Reitz, 2018/10/05
- [Qemu-devel] [PATCH v11 03/31] block: Skip implicit nodes for filename info,
Max Reitz <=