summaryrefslogtreecommitdiffstats
path: root/block.c
diff options
context:
space:
mode:
authorMax Reitz2019-02-01 20:29:06 +0100
committerMax Reitz2019-02-25 15:11:25 +0100
commite24518e303e6a4372eba67a8bd3c8730a02b86f0 (patch)
tree1729be725161d9cd824373b02b1d0c2dae7d28b1 /block.c
parentblock: Use bdrv_refresh_filename() to pull (diff)
downloadqemu-e24518e303e6a4372eba67a8bd3c8730a02b86f0.tar.gz
qemu-e24518e303e6a4372eba67a8bd3c8730a02b86f0.tar.xz
qemu-e24518e303e6a4372eba67a8bd3c8730a02b86f0.zip
block: Use children list in bdrv_refresh_filename
bdrv_refresh_filename() should invoke itself recursively on all children, not just on file. With that change, we can remove the manual invocations in blkverify, quorum, commit, mirror, and blklogwrites. 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-3-mreitz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
Diffstat (limited to 'block.c')
-rw-r--r--block.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/block.c b/block.c
index 88aa687a68..d97f5e7084 100644
--- a/block.c
+++ b/block.c
@@ -5536,16 +5536,17 @@ static bool append_open_options(QDict *d, BlockDriverState *bs)
void bdrv_refresh_filename(BlockDriverState *bs)
{
BlockDriver *drv = bs->drv;
+ BdrvChild *child;
QDict *opts;
if (!drv) {
return;
}
- /* This BDS's file name will most probably depend on its file's name, so
- * refresh that first */
- if (bs->file) {
- bdrv_refresh_filename(bs->file->bs);
+ /* This BDS's file name may depend on any of its children's file names, so
+ * refresh those first */
+ QLIST_FOREACH(child, &bs->children, next) {
+ bdrv_refresh_filename(child->bs);
}
if (drv->bdrv_refresh_filename) {