mirror of
https://github.com/qemu/qemu.git
synced 2024-12-07 18:53:38 +08:00
998b3a1e5a
Currently, BlockDriver.bdrv_refresh_filename() is supposed to both refresh the filename (BDS.exact_filename) and set BDS.full_open_options. Now that we have generic code in the central bdrv_refresh_filename() for creating BDS.full_open_options, we can drop the latter part from all BlockDriver.bdrv_refresh_filename() implementations. This also means that we can drop all of the existing default code for this from the global bdrv_refresh_filename() itself. Furthermore, we now have to call BlockDriver.bdrv_refresh_filename() after having set BDS.full_open_options, because the block driver's implementation should now be allowed to depend on BDS.full_open_options being set correctly. Finally, with this patch we can drop the @options parameter from BlockDriver.bdrv_refresh_filename(); also, add a comment on this function's purpose in block/block_int.h while touching its interface. This completely obsoletes blklogwrite's implementation of .bdrv_refresh_filename(). Signed-off-by: Max Reitz <mreitz@redhat.com> Message-id: 20190201192935.18394-25-mreitz@redhat.com Signed-off-by: Max Reitz <mreitz@redhat.com>
85 lines
3.7 KiB
Plaintext
85 lines
3.7 KiB
Plaintext
--- Implicit backing file ---
|
|
|
|
{"execute": "blockdev-add", "arguments": {"driver": "IMGFMT", "file": {"driver": "file", "filename": "TEST_DIR/PID-top.img"}, "node-name": "node0"}}
|
|
{"return": {}}
|
|
|
|
bs->filename: TEST_DIR/PID-top.img
|
|
bs->backing_file: TEST_DIR/PID-base.img
|
|
bs->backing->bs->filename: TEST_DIR/PID-base.img
|
|
|
|
{"execute": "blockdev-del", "arguments": {"node-name": "node0"}}
|
|
{"return": {}}
|
|
|
|
--- change-backing-file ---
|
|
|
|
{"execute": "blockdev-add", "arguments": {"driver": "IMGFMT", "file": {"driver": "file", "filename": "TEST_DIR/PID-top.img"}, "node-name": "node0"}}
|
|
{"return": {}}
|
|
{"execute": "change-backing-file", "arguments": {"backing-file": "null-co://", "device": "node0", "image-node-name": "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->backing_file: null-co://
|
|
bs->backing->bs->filename: TEST_DIR/PID-base.img
|
|
|
|
{"execute": "change-backing-file", "arguments": {"backing-file": "TEST_DIR/PID-base.img", "device": "node0", "image-node-name": "node0"}}
|
|
{"return": {}}
|
|
|
|
bs->filename: TEST_DIR/PID-top.img
|
|
bs->backing_file: TEST_DIR/PID-base.img
|
|
bs->backing->bs->filename: TEST_DIR/PID-base.img
|
|
|
|
{"execute": "change-backing-file", "arguments": {"backing-file": "file:TEST_DIR/PID-base.img", "device": "node0", "image-node-name": "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->backing_file: file:TEST_DIR/PID-base.img
|
|
bs->backing->bs->filename: TEST_DIR/PID-base.img
|
|
|
|
{"execute": "blockdev-del", "arguments": {"node-name": "node0"}}
|
|
{"return": {}}
|
|
{"execute": "blockdev-add", "arguments": {"driver": "IMGFMT", "file": {"driver": "file", "filename": "TEST_DIR/PID-top.img"}, "node-name": "node0"}}
|
|
{"return": {}}
|
|
|
|
bs->filename: TEST_DIR/PID-top.img
|
|
bs->backing_file: TEST_DIR/PID-base.img
|
|
bs->backing->bs->filename: TEST_DIR/PID-base.img
|
|
|
|
{"execute": "blockdev-del", "arguments": {"node-name": "node0"}}
|
|
{"return": {}}
|
|
|
|
--- Override backing file ---
|
|
|
|
{"execute": "blockdev-add", "arguments": {"driver": "null-co", "node-name": "null"}}
|
|
{"return": {}}
|
|
{"execute": "blockdev-add", "arguments": {"backing": "null", "driver": "IMGFMT", "file": {"driver": "file", "filename": "TEST_DIR/PID-top.img"}, "node-name": "node0"}}
|
|
{"return": {}}
|
|
|
|
bs->filename: json:{"backing": {"driver": "null-co"}, "driver": "IMGFMT", "file": {"driver": "file", "filename": "TEST_DIR/PID-top.img"}}
|
|
bs->backing_file: null-co://
|
|
bs->backing->bs->filename: null-co://
|
|
|
|
{"execute": "blockdev-del", "arguments": {"node-name": "node0"}}
|
|
{"return": {}}
|
|
{"execute": "blockdev-del", "arguments": {"node-name": "null"}}
|
|
{"return": {}}
|
|
{"execute": "blockdev-add", "arguments": {"backing": null, "driver": "IMGFMT", "file": {"driver": "file", "filename": "TEST_DIR/PID-top.img"}, "node-name": "node0"}}
|
|
{"return": {}}
|
|
|
|
bs->filename: json:{"backing": null, "driver": "IMGFMT", "file": {"driver": "file", "filename": "TEST_DIR/PID-top.img"}}
|
|
bs->backing_file: TEST_DIR/PID-base.img
|
|
bs->backing: (none)
|
|
|
|
{"execute": "blockdev-add", "arguments": {"driver": "IMGFMT", "file": {"driver": "file", "filename": "TEST_DIR/PID-base.img"}, "node-name": "original-backing"}}
|
|
{"return": {}}
|
|
{"execute": "blockdev-snapshot", "arguments": {"node": "original-backing", "overlay": "node0"}}
|
|
{"return": {}}
|
|
|
|
bs->filename: TEST_DIR/PID-top.img
|
|
bs->backing_file: TEST_DIR/PID-base.img
|
|
bs->backing->bs->filename: TEST_DIR/PID-base.img
|
|
|
|
{"execute": "blockdev-del", "arguments": {"node-name": "node0"}}
|
|
{"return": {}}
|
|
{"execute": "blockdev-del", "arguments": {"node-name": "original-backing"}}
|
|
{"return": {}}
|