From 97e2f021f844383d85de526ce88667ca34ecd277 Mon Sep 17 00:00:00 2001 From: Max Reitz Date: Fri, 1 Feb 2019 20:29:27 +0100 Subject: block: Generically refresh runtime options Instead of having every block driver which implements bdrv_refresh_filename() copy all of the strong runtime options over to bs->full_open_options, implement this process generically in bdrv_refresh_filename(). This patch only adds this new generic implementation, it does not remove the old functionality. This is done in a follow-up patch. With this patch, some superfluous information (that should never have been there) may be removed from some JSON filenames, as can be seen in the change to iotests 110's and 228's reference outputs. Signed-off-by: Max Reitz Message-id: 20190201192935.18394-24-mreitz@redhat.com Signed-off-by: Max Reitz --- tests/qemu-iotests/110.out | 2 +- tests/qemu-iotests/228 | 7 ++++--- tests/qemu-iotests/228.out | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/qemu-iotests/110.out b/tests/qemu-iotests/110.out index 1d0b247..46e6a60 100644 --- a/tests/qemu-iotests/110.out +++ b/tests/qemu-iotests/110.out @@ -22,7 +22,7 @@ Formatting 'TEST_DIR/t.IMGFMT', fmt=IMGFMT size=67108864 backing_file=t.IMGFMT.b === Nodes without a common directory === -image: json:{"driver": "IMGFMT", "file": {"children": [{"driver": "file", "filename": "TEST_DIR/t.IMGFMT"}, {"driver": "file", "filename": "TEST_DIR/t.IMGFMT.copy"}], "driver": "quorum", "blkverify": false, "rewrite-corrupted": false, "vote-threshold": 1}} +image: json:{"driver": "IMGFMT", "file": {"children": [{"driver": "file", "filename": "TEST_DIR/t.IMGFMT"}, {"driver": "file", "filename": "TEST_DIR/t.IMGFMT.copy"}], "driver": "quorum", "vote-threshold": 1}} file format: IMGFMT virtual size: 64M (67108864 bytes) backing file: t.IMGFMT.base (cannot determine actual path) diff --git a/tests/qemu-iotests/228 b/tests/qemu-iotests/228 index 2930f84..7a57c41 100755 --- a/tests/qemu-iotests/228 +++ b/tests/qemu-iotests/228 @@ -230,9 +230,10 @@ with iotests.FilePath('base.img') as base_img_path, \ overlay='node0') # This should give us the original plain result - # FIXME: Currently, the block layer considers the runtime backing - # file to be different from the image header, which is - # wrong. This is fixed by a future patch. + # FIXME: Currently, it yields a json:{} filename even though it + # only contains a @driver and a @file entry, so a plain + # filename would obviously suffice. This is fixed by a + # future patch. log_node_info(vm.node_info('node0')) diff --git a/tests/qemu-iotests/228.out b/tests/qemu-iotests/228.out index 57fe97d..393ab09 100644 --- a/tests/qemu-iotests/228.out +++ b/tests/qemu-iotests/228.out @@ -74,7 +74,7 @@ bs->backing: (none) {"execute": "blockdev-snapshot", "arguments": {"node": "original-backing", "overlay": "node0"}} {"return": {}} -bs->filename: json:{"backing": {"driver": "IMGFMT", "file": {"driver": "file", "filename": "TEST_DIR/PID-base.img"}}, "driver": "IMGFMT", "file": {"driver": "file", "filename": "TEST_DIR/PID-top.img"}} +bs->filename: json:{"driver": "IMGFMT", "file": {"driver": "file", "filename": "TEST_DIR/PID-top.img"}} bs->backing_file: TEST_DIR/PID-base.img bs->backing->bs->filename: TEST_DIR/PID-base.img -- cgit v1.1