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

[libvirt] [PATCH libvirt-java 8/9] Implement and use virDomainMigrateToURI2 instead of virDomainMigrateToURI



The migrateToURI method now uses virDomainMigrateToURI2 so we can support
some more features.

Signed-off-by: Wido den Hollander <wido widodh nl>
---
 src/main/java/org/libvirt/Domain.java      |   33 +++++++++++++++++++++++++---
 src/main/java/org/libvirt/jna/Libvirt.java |    2 ++
 2 files changed, 32 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/libvirt/Domain.java b/src/main/java/org/libvirt/Domain.java
index 03afa0e..6fb1161 100644
--- a/src/main/java/org/libvirt/Domain.java
+++ b/src/main/java/org/libvirt/Domain.java
@@ -855,6 +855,35 @@ public class Domain {
      *       href="http://www.libvirt.org/html/libvirt-libvirt.html#virDomainMigrateToURI";>
      *       virDomainMigrateToURI</a>
      *
+     * @param dconnuri
+     *            (optional) URI for target libvirtd if @flags includes VIR_MIGRATE_PEER2PEER
+     * @param miguri
+     *            (optional) URI for invoking the migration, not if @flags includs VIR_MIGRATE_TUNNELLED
+     * @param dxml
+     *            (optional) XML config for launching guest on target
+     * @param flags
+     *            Controls the migrate
+     * @param dname
+     *            The name at the destnation
+     * @param bandwidth
+     *            Specify the migration bandwidth
+     * @return 0 if successful, -1 if not
+     * @throws LibvirtException
+     */
+    public int migrateToURI(String dconnuri, String miguri, String dxml, long flags, String dname, long bandwidth) throws LibvirtException {
+        int returnValue = libvirt.virDomainMigrateToURI2(VDP, dconnuri, miguri, dxml, new NativeLong(flags), dname, new NativeLong(bandwidth));
+        processError();
+        return returnValue;
+    }
+
+    /**
+     * Migrate the domain object from its current host to the destination host
+     * given by duri.
+     *
+     * @see <a
+     *       href="http://www.libvirt.org/html/libvirt-libvirt.html#virDomainMigrateToURI";>
+     *       virDomainMigrateToURI</a>
+     *
      * @param uri
      *            The destination URI
      * @param flags
@@ -867,9 +896,7 @@ public class Domain {
      * @throws LibvirtException
      */
     public int migrateToURI(String uri, long flags, String dname, long bandwidth) throws LibvirtException {
-        int returnValue = libvirt.virDomainMigrateToURI(VDP, uri, new NativeLong(flags), dname, new NativeLong(bandwidth));
-        processError();
-        return returnValue;
+        return migrateToURI(uri, null, null, flags, dname, bandwidth);
     }
 
     /**
diff --git a/src/main/java/org/libvirt/jna/Libvirt.java b/src/main/java/org/libvirt/jna/Libvirt.java
index de2a262..27011d9 100644
--- a/src/main/java/org/libvirt/jna/Libvirt.java
+++ b/src/main/java/org/libvirt/jna/Libvirt.java
@@ -214,6 +214,8 @@ public interface Libvirt extends Library {
     public int virDomainMigrateSetMaxDowntime(DomainPointer virDomainPtr, long downtime, int flags);
     public int virDomainMigrateToURI(DomainPointer virDomainPtr, String duri,
             NativeLong flags, String dname, NativeLong bandwidth);
+    public int virDomainMigrateToURI2(DomainPointer virDomainPtr, String dconnuri, String miguri,
+            String dxml, NativeLong flags, String dname, NativeLong bandwidth);
     public int virDomainMemoryStats(DomainPointer virDomainPtr, virDomainMemoryStats[] stats, int nr_stats, int flags);
     public int virDomainPinVcpu(DomainPointer virDomainPtr, int vcpu, byte[] cpumap, int maplen);
     public int virDomainReboot(DomainPointer virDomainPtr, int flags);
-- 
1.7.9.5


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