]> git.proxmox.com Git - mirror_qemu.git/commit - blockdev.c
blockdev: Snapshotting must not open second instance of old top
authorKevin Wolf <kwolf@redhat.com>
Wed, 2 Mar 2016 11:16:44 +0000 (12:16 +0100)
committerKevin Wolf <kwolf@redhat.com>
Mon, 14 Mar 2016 15:46:43 +0000 (16:46 +0100)
commitf86b8b584b114d68036bf576057f51caec7b94ba
tree3b4395f4a1a9b11831d59aab29a031c6f645ff1d
parent924e8a2bbc7cc62b3996efe9a2a460f541c04520
blockdev: Snapshotting must not open second instance of old top

Calling bdrv_img_create() with a size of -1 means that it determines the
size automatically by opening the backing file. However, in the case of
live snapshots, the backing file is already opened and we must avoid
opening the same image twice at the same time. Apart from that, just
getting the size from the already existing BDS is a lot less overhead
than opening a new instance.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Jeff Cody <jcody@redhat.com>
blockdev.c