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

[libvirt] [PATCH libvirt-java 7/7] Implement and use virDomainMigrateToURI2 by overloading migrateToUri



The new migrateToUri method has the dxml argument which has been added
in virDomainMigrateToUri2.

The original migrateToUri method still uses virDomainMigrateToUri to
be sure we don't break backwards compatibility.

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

diff --git a/src/main/java/org/libvirt/Domain.java b/src/main/java/org/libvirt/Domain.java
index 2758747..c903bac 100644
--- a/src/main/java/org/libvirt/Domain.java
+++ b/src/main/java/org/libvirt/Domain.java
@@ -907,6 +907,35 @@ public class Domain {
      * given by duri.
      *
      * @see <a
+     * 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
+     * @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>
      *
diff --git a/src/main/java/org/libvirt/jna/Libvirt.java b/src/main/java/org/libvirt/jna/Libvirt.java
index 4a8bdf3..8c7d6ef 100644
--- a/src/main/java/org/libvirt/jna/Libvirt.java
+++ b/src/main/java/org/libvirt/jna/Libvirt.java
@@ -226,6 +226,8 @@ public interface Libvirt extends Library {
     int virDomainMigrateSetMaxDowntime(DomainPointer virDomainPtr, long downtime, int flags);
     int virDomainMigrateToURI(DomainPointer virDomainPtr, String duri,
             NativeLong flags, String dname, NativeLong bandwidth);
+    int virDomainMigrateToURI2(DomainPointer virDomainPtr, String dconnuri, String miguri,
+            String dxml, NativeLong flags, String dname, NativeLong bandwidth);
     int virDomainMemoryStats(DomainPointer virDomainPtr, virDomainMemoryStats[] stats, int nr_stats, int flags);
     int virDomainPinVcpu(DomainPointer virDomainPtr, int vcpu, byte[] cpumap, int maplen);
     int virDomainReboot(DomainPointer virDomainPtr, int flags);
-- 
1.7.9.5


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