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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Wido den Hollander <wido@xxxxxxxxx>
---
 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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]