]> git.proxmox.com Git - mirror_qemu.git/commit - block.c
block: Respect backing bs in bdrv_refresh_filename
authorMax Reitz <mreitz@redhat.com>
Fri, 1 Feb 2019 19:29:09 +0000 (20:29 +0100)
committerMax Reitz <mreitz@redhat.com>
Mon, 25 Feb 2019 14:11:25 +0000 (15:11 +0100)
commit909936234c38d92921f055f8cf19a7dca1bd9aa1
tree6330b844f70ed0f1e563a2483c67d4221874a290
parent998c201923a5e082f362566d234dfd6057e4a19a
block: Respect backing bs in bdrv_refresh_filename

Basically, bdrv_refresh_filename() should respect all children of a
BlockDriverState. However, generally those children are driver-specific,
so this function cannot handle the general case. On the other hand,
there are only few drivers which use other children than @file and
@backing (that being vmdk, quorum, and blkverify).

Most block drivers only use @file and/or @backing (if they use any
children at all). Both can be implemented directly in
bdrv_refresh_filename.

The user overriding the file's filename is already handled, however, the
user overriding the backing file is not. If this is done, opening the
BDS with the plain filename of its file will not be correct, so we may
not set bs->exact_filename in that case.

iotest 051 contains test cases for overriding the backing file, and so
its output changes with this patch applied.

Signed-off-by: Max Reitz <mreitz@redhat.com>
Reviewed-by: Alberto Garcia <berto@igalia.com>
Message-id: 20190201192935.18394-6-mreitz@redhat.com
Signed-off-by: Max Reitz <mreitz@redhat.com>
block.c
tests/qemu-iotests/051.out
tests/qemu-iotests/051.pc.out