aboutsummaryrefslogtreecommitdiff
path: root/block.h
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>2012-03-05 18:10:11 +0000
committerKevin Wolf <kwolf@redhat.com>2012-03-12 15:14:06 +0100
commite88774971c33671477c9eb4a4cf1e65a047c9838 (patch)
tree40539c222564c287d56d9130f65633494eecb01c /block.h
parent3cce16f44dc51b8695a144b7b0437548f886276e (diff)
downloadqemu-e88774971c33671477c9eb4a4cf1e65a047c9838.zip
qemu-e88774971c33671477c9eb4a4cf1e65a047c9838.tar.gz
qemu-e88774971c33671477c9eb4a4cf1e65a047c9838.tar.bz2
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>
Diffstat (limited to 'block.h')
-rw-r--r--block.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/block.h b/block.h
index 48d0bf3..415bb17 100644
--- a/block.h
+++ b/block.h
@@ -165,7 +165,7 @@ int64_t bdrv_get_allocated_file_size(BlockDriverState *bs);
void bdrv_get_geometry(BlockDriverState *bs, uint64_t *nb_sectors_ptr);
void bdrv_guess_geometry(BlockDriverState *bs, int *pcyls, int *pheads, int *psecs);
int bdrv_commit(BlockDriverState *bs);
-void bdrv_commit_all(void);
+int bdrv_commit_all(void);
int bdrv_change_backing_file(BlockDriverState *bs,
const char *backing_file, const char *backing_fmt);
void bdrv_register(BlockDriver *bdrv);