]> git.proxmox.com Git - mirror_qemu.git/commit - blockdev.c
block: handle -EBUSY in bdrv_commit_all()
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Mon, 5 Mar 2012 18:10:11 +0000 (18:10 +0000)
committerKevin Wolf <kwolf@redhat.com>
Mon, 12 Mar 2012 14:14:06 +0000 (15:14 +0100)
commite88774971c33671477c9eb4a4cf1e65a047c9838
tree40539c222564c287d56d9130f65633494eecb01c
parent3cce16f44dc51b8695a144b7b0437548f886276e
block: handle -EBUSY in bdrv_commit_all()

Monitor operations that manipulate image files must not execute while a
background job (like image streaming) is in progress.  This prevents
corruptions from happening when two pieces of code are manipulating the
image file without knowledge of each other.

The monitor "commit" command raises QERR_DEVICE_IN_USE when
bdrv_commit() returns -EBUSY but "commit all" has no error handling.
This is easy to fix, although note that we do not deliver a detailed
error about which device was busy in the "commit all" case.

Suggested-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c
block.h
blockdev.c