On 01/11/2017 12:14 PM, Max Reitz wrote: The mail archives show this series stopping at 4/25; what happened to 5-25? https://lists.gnu.org/archive/html/qemu-devel/2017-01/threads.html#01912
> 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 overwriting the backing file, and so > its output changes with this patch applied (which I consider a good > thing). > > Signed-off-by: Max Reitz <mre...@redhat.com> > --- > block.c | 12 +++++++++++- > tests/qemu-iotests/051.out | 8 ++++---- > tests/qemu-iotests/051.pc.out | 8 ++++---- > 3 files changed, 19 insertions(+), 9 deletions(-) > Reviewed-by: Eric Blake <ebl...@redhat.com> > +++ b/tests/qemu-iotests/051.out > @@ -59,7 +59,7 @@ QEMU X.Y.Z monitor - type 'help' for more information > Testing: -drive > file=TEST_DIR/t.qcow2,driver=qcow2,backing.file.filename=TEST_DIR/t.qcow2.orig,if=none,id=drive0 > -nodefaults > QEMU X.Y.Z monitor - type 'help' for more information > (qemu) i[K[Din[K[D[Dinf[K[D[D[Dinfo[K[D[D[D[Dinfo > [K[D[D[D[D[Dinfo b[K[D[D[D[D[D[Dinfo > bl[K[D[D[D[D[D[D[Dinfo blo[K[D[D[D[D[D[D[D[Dinfo > bloc[K[D[D[D[D[D[D[D[D[Dinfo block[K > -drive0 (NODE_NAME): TEST_DIR/t.qcow2 (qcow2) > +drive0 (NODE_NAME): json:{"backing": {"driver": "qcow2", "file": {"driver": > "file", "filename": "TEST_DIR/t.qcow2.orig"}}, "driver": "qcow2", "file": > {"driver": "file", "filename": "TEST_DIR/t.qcow2"}} (qcow2) These test files are a pain to read, but I concur that the resulting output looks better now that it is obvious that the backing file has been overridden. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature