[libvirt] [PATCH 17/16] save: new API to manipulate save file images

Daniel P. Berrange berrange at redhat.com
Thu Jul 21 11:42:06 UTC 2011


On Wed, Jul 20, 2011 at 02:54:23PM -0600, Eric Blake wrote:
> Modifying the xml on either save or restore only gets you so
> far - you have to remember to 'virsh dumpxml dom' just prior
> to the 'virsh save' in order to have an xml file worth modifying
> that won't be rejected due to abi breaks.  To make this more
> powerful, we need a way to grab the xml embedded within a state
> file, and from there, it's not much harder to also support
> modifying a state file in-place.
> 
> Also, virDomainGetXMLDesc didn't document its flags.
> 
> * include/libvirt/libvirt.h.in (virDomainSaveImageGetXMLDesc)
> (virDomainSaveImageDefineXML): New prototypes.
> * src/libvirt.c (virDomainSaveImageGetXMLDesc)
> (virDomainSaveImageDefineXML): New API.
> * src/libvirt_public.syms: Export them.
> * src/driver.h (virDrvDomainSaveImageGetXMLDesc)
> (virDrvDomainSaveImgeDefineXML): New driver callbacks.
> ---
> 
> I've waffled over various choices for naming this API, such as
> virConnectDomainSaveGetXMLDesc, but I think what I've chosen
> works out well - it creates the new virDomainSaveImage* prefix
> for use with any other commands that might also later operate
> on a domain saved state file.
> 
> Saved state is always inactive (the guest shuts down during
> virDomainSave), so the VIR_DOMAIN_XML_INACTIVE flag would be
> a no-op if it were accepted; I suppose I could silently ignore
> it, but as written the patches reject it instead.
> 
> I'm not sure whether VIR_DOMAIN_XML_UPDATE_CPU makes sense, so
> I rejected it.
> 
>  include/libvirt/libvirt.h.in |    9 ++-
>  src/driver.h                 |   11 +++
>  src/libvirt.c                |  158 +++++++++++++++++++++++++++++++++++++++++-
>  src/libvirt_public.syms      |    2 +
>  4 files changed, 178 insertions(+), 2 deletions(-)

ACK

Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|




More information about the libvir-list mailing list