aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2012-01-31 21:19:51 -0700
committerEric Blake <eblake@redhat.com>2012-02-01 15:21:56 -0700
commit99fd69c3dea9728e21b9dcc668290a75be3efc48 (patch)
treea69a46f115df596a46eee30a62f178af4be95552 /include
parentqemu: Add support for virDomainGetMetadata and virDomainSetMetadata (diff)
downloadlibvirt-99fd69c3dea9728e21b9dcc668290a75be3efc48.tar.gz
libvirt-99fd69c3dea9728e21b9dcc668290a75be3efc48.tar.bz2
libvirt-99fd69c3dea9728e21b9dcc668290a75be3efc48.zip
block rebase: add new API virDomainBlockRebase
Qemu is adding the ability to do a partial rebase. That is, given: base <- intermediate <- current virDomainBlockPull will produce: current but qemu now has the ability to leave base in the chain, to produce: base <- current Note that current qemu can only do a forward merge, and only with the current image as the destination, which is fully described by this API without flags. But in the future, it may be possible to enhance this API for additional scenarios by using flags: Merging the current image back into a previous image (that is, undoing a live snapshot), could be done by passing base as the destination and flags with a bit requesting a backward merge. Merging any other part of the image chain, whether forwards (the backing image contents are pulled into the newer file) or backwards (the deltas recorded in the newer file are merged back into the backing file), could also be done by passing a new flag that says that base should be treated as an XML snippet rather than an absolute path name, where the XML could then supply the additional instructions of which part of the image chain is being merged into any other part. * include/libvirt/libvirt.h.in (virDomainBlockRebase): New declaration. * src/libvirt.c (virDomainBlockRebase): Implement it. * src/libvirt_public.syms (LIBVIRT_0.9.10): Export it. * src/driver.h (virDrvDomainBlockRebase): New driver callback. * src/rpc/gendispatch.pl (long_legacy): Add exemption. * docs/apibuild.py (long_legacy_functions): Likewise.
Diffstat (limited to 'include')
-rw-r--r--include/libvirt/libvirt.h.in9
1 files changed, 7 insertions, 2 deletions
diff --git a/include/libvirt/libvirt.h.in b/include/libvirt/libvirt.h.in
index 07d03fa16..2b4adda6d 100644
--- a/include/libvirt/libvirt.h.in
+++ b/include/libvirt/libvirt.h.in
@@ -1888,7 +1888,8 @@ int virDomainUpdateDeviceFlags(virDomainPtr domain,
/**
* virDomainBlockJobType:
*
- * VIR_DOMAIN_BLOCK_JOB_TYPE_PULL: Block Pull (virDomainBlockPull)
+ * VIR_DOMAIN_BLOCK_JOB_TYPE_PULL: Block Pull (virDomainBlockPull or
+ * virDomainBlockRebase)
*/
typedef enum {
VIR_DOMAIN_BLOCK_JOB_TYPE_UNKNOWN = 0,
@@ -1927,6 +1928,9 @@ int virDomainBlockJobSetSpeed(virDomainPtr dom, const char *disk,
int virDomainBlockPull(virDomainPtr dom, const char *disk,
unsigned long bandwidth, unsigned int flags);
+int virDomainBlockRebase(virDomainPtr dom, const char *disk,
+ const char *base, unsigned long bandwidth,
+ unsigned int flags);
/* Block I/O throttling support */
@@ -3558,7 +3562,8 @@ typedef void (*virConnectDomainEventGraphicsCallback)(virConnectPtr conn,
/**
* virConnectDomainEventBlockJobStatus:
*
- * The final status of a virDomainBlockPullAll() operation
+ * The final status of a virDomainBlockPull() or virDomainBlockRebase()
+ * operation
*/
typedef enum {
VIR_DOMAIN_BLOCK_JOB_COMPLETED = 0,