summaryrefslogtreecommitdiff
path: root/block_int.h
diff options
context:
space:
mode:
authorJeff Cody <jcody@redhat.com>2012-09-27 13:29:13 -0400
committerKevin Wolf <kwolf@redhat.com>2012-09-28 18:23:12 +0200
commit747ff602636fd83daae7ee4b1dd6e8d257a89fea (patch)
treef11ef05dd801243c5afc345209d12772a2789609 /block_int.h
parent6ebdcee2d8e9e4b41ffe4e49039927550848b926 (diff)
downloadqemu-747ff602636fd83daae7ee4b1dd6e8d257a89fea.tar.gz
block: add live block commit functionality
This adds the live commit coroutine. This iteration focuses on the commit only below the active layer, and not the active layer itself. The behaviour is similar to block streaming; the sectors are walked through, and anything that exists above 'base' is committed back down into base. At the end, intermediate images are deleted, and the chain stitched together. Images are restored to their original open flags upon completion. Signed-off-by: Jeff Cody <jcody@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block_int.h')
-rw-r--r--block_int.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/block_int.h b/block_int.h
index ac4245cb18..56164a742a 100644
--- a/block_int.h
+++ b/block_int.h
@@ -463,4 +463,20 @@ void stream_start(BlockDriverState *bs, BlockDriverState *base,
BlockDriverCompletionFunc *cb,
void *opaque, Error **errp);
+/**
+ * commit_start:
+ * @bs: Top Block device
+ * @base: Block device that will be written into, and become the new top
+ * @speed: The maximum speed, in bytes per second, or 0 for unlimited.
+ * @on_error: The action to take upon error.
+ * @cb: Completion function for the job.
+ * @opaque: Opaque pointer value passed to @cb.
+ * @errp: Error object.
+ *
+ */
+void commit_start(BlockDriverState *bs, BlockDriverState *base,
+ BlockDriverState *top, int64_t speed,
+ BlockErrorAction on_error, BlockDriverCompletionFunc *cb,
+ void *opaque, Error **errp);
+
#endif /* BLOCK_INT_H */