]> git.ipfire.org Git - thirdparty/qemu.git/commit - block.c
block: Fix snapshot=on for protocol parsed from filename
authorKevin Wolf <kwolf@redhat.com>
Thu, 3 Apr 2014 10:09:34 +0000 (12:09 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 4 Apr 2014 17:35:51 +0000 (19:35 +0200)
commitb998875dcf2b21678cffa8b9a83c09930523861f
tree9a2b8622d1745577543346a6854224dd7a9dbcec
parentcd40890816a40ba70d4cd2107629a417f0f3c648
block: Fix snapshot=on for protocol parsed from filename

Since commit 9fd3171a, BDRV_O_SNAPSHOT uses an option QDict to specify
the originally requested image as the backing file of the newly created
temporary snapshot. This means that the filename is stored in
"file.filename", which is an option that is not parsed for protocol
names. Therefore things like -drive file=nbd:localhost:10809 were
broken because it looked for a local file with the literal name
'nbd:localhost:10809'.

This patch changes the way BDRV_O_SNAPSHOT works once again. We now open
the originally requested image as normal, and then do a similar
operation as for live snapshots to put the temporary snapshot on top.
This way, both driver specific options and parsed filenames work.

As a nice side effect, this results in code movement to factor
bdrv_append_temp_snapshot() out. This is a good preparation for moving
its call to drive_init() and friends eventually.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
block.c
include/block/block.h
tests/qemu-iotests/051
tests/qemu-iotests/051.out