]> xenbits.xensource.com Git - libvirt.git/commit
block rebase: add new API virDomainBlockRebase
authorEric Blake <eblake@redhat.com>
Wed, 1 Feb 2012 04:19:51 +0000 (21:19 -0700)
committerEric Blake <eblake@redhat.com>
Wed, 1 Feb 2012 22:21:56 +0000 (15:21 -0700)
commit99fd69c3dea9728e21b9dcc668290a75be3efc48
treea69a46f115df596a46eee30a62f178af4be95552
parent21d13ddc5d2e1ba24fec401fd7aec0f33f0fecf0
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.
docs/apibuild.py
include/libvirt/libvirt.h.in
src/driver.h
src/libvirt.c
src/libvirt_public.syms
src/rpc/gendispatch.pl