[libvirt] [PATCH libvirt-java 4/9] Add the option to pass flags for snapshotCreateXML

Wido den Hollander wido at widodh.nl
Sat Jan 5 11:48:21 UTC 2013


Signed-off-by: Wido den Hollander <wido at widodh.nl>
---
 src/main/java/org/libvirt/Domain.java |   24 +++++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/libvirt/Domain.java b/src/main/java/org/libvirt/Domain.java
index 4b4c572..e0be43d 100644
--- a/src/main/java/org/libvirt/Domain.java
+++ b/src/main/java/org/libvirt/Domain.java
@@ -997,18 +997,20 @@ public class Domain {
 
     /**
      * Creates a new snapshot of a domain based on the snapshot xml contained in
-     * xmlDesc.
+     * xmlDesc with the option to pass flags
      *
      * @see <a
      *      href="http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSnapshotCreateXML">Libvirt
      *      Documentation</a>
      * @param xmlDesc
      *            string containing an XML description of the domain
+     * @param flags
+     *            flags for creating the snapshot, see the virDomainSnapshotCreateFlags for the flag options
      * @return the snapshot, or null on Error
      * @throws LibvirtException
      */
-    public DomainSnapshot snapshotCreateXML(String xmlDesc) throws LibvirtException {
-        DomainSnapshotPointer ptr = libvirt.virDomainSnapshotCreateXML(VDP, xmlDesc, 0);
+    public DomainSnapshot snapshotCreateXML(String xmlDesc, int flags) throws LibvirtException {
+        DomainSnapshotPointer ptr = libvirt.virDomainSnapshotCreateXML(VDP, xmlDesc, flags);
         processError();
         DomainSnapshot returnValue = null;
         if (ptr != null) {
@@ -1018,6 +1020,22 @@ public class Domain {
     }
 
     /**
+     * Creates a new snapshot of a domain based on the snapshot xml contained in
+     * xmlDesc.
+     *
+     * @see <a
+     *      href="http://www.libvirt.org/html/libvirt-libvirt.html#virDomainSnapshotCreateXML">Libvirt
+     *      Documentation</a>
+     * @param xmlDesc
+     *            string containing an XML description of the domain
+     * @return the snapshot, or null on Error
+     * @throws LibvirtException
+     */
+    public DomainSnapshot snapshotCreateXML(String xmlDesc) throws LibvirtException {
+        return snapshotCreateXML(xmlDesc, 0);
+    }
+
+    /**
      * Get the current snapshot for a domain, if any.
      *
      * @see <a
-- 
1.7.9.5




More information about the libvir-list mailing list