
On 06/11/2012 12:48 AM, Osier Yang wrote:
On 2012年05月25日 11:33, Eric Blake wrote:
Right now, starting from just a virDomainSnapshotPtr, and wanting to know if it is the current snapshot for its respective domain, you have to use virDomainSnapshotGetDomain(), then virDomainSnapshotCurrent(), then compare the two names returned by virDomainSnapshotGetName(). It is a bit easier if we can directly query this information from the snapshot itself.
* include/libvirt/libvirt.h.in (virDomainSnapshotIsCurrent) (virDomainSnapshotHasMetadata): New declarations. * src/libvirt.c (virDomainSnapshotIsCurrent) (virDomainSnapshotHasMetadata): New functions. * src/libvirt_public.syms (LIBVIRT_0.9.13): Export them. * src/driver.h (virDrvDomainSnapshotIsCurrent) (virDrvDomainSnapshotHasMetadata): New driver callbacks.
+LIBVIRT_0.9.13 { + global: + virDomainSnapshotHasMetadata; + virDomainSnapshotIsCurrent; +} LIBVIRT_0.9.11; + # .... define new API here using predicted next version number ....
I'm not hep in the overall snapshot design, but the APIs looks quite straightforward, so ACK.
Thanks; I've gone ahead and pushed this patch (which means we are now committed to providing it before 0.9.13); this of course means that other API additions probably have to rebase, but that should be relatively straightforward conflict resolution. I will split and repost patch 4/4 into two patches, one for qemu (which appeared to be non-controversial) and one for esx/vbox (which may depend on list consensus on whether blind success is desirable). -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org