]> git.proxmox.com Git - qemu.git/commit
block: fix BDRV_O_SNAPSHOT protocol detection
authorStefan Hajnoczi <stefanha@redhat.com>
Mon, 18 Mar 2013 16:58:53 +0000 (17:58 +0100)
committerKevin Wolf <kwolf@redhat.com>
Tue, 19 Mar 2013 10:48:37 +0000 (11:48 +0100)
commit4d70655bcb852ea0a006d3923f0b0a9c69ff462e
tree07f0dec6ffc8266ccda62c70a12242c2c50d2801
parentacdfb480ba7e2779bdbffb5280cf12ff6e43669c
block: fix BDRV_O_SNAPSHOT protocol detection

realpath(3) is used to get an absolute path to the image file when
creating a -drive snapshot=on temporary qcow2.  This does not work for
protocols since their filenames ("proto:foo:...") do not correspond to
file system paths.

Commit 7c96d46ec245d73fd76726588409f9abe4bd5dc1 ("Let snapshot work with
protocols") skipped realpath(3) for protocols.  Later on the "raw"
format was introduced and broke the check.

Use path_has_protocol(filename) to decide if this image uses a protocol
or a filename.

Reported-by: Richard Jones <rjones@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c