You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by bh...@apache.org on 2015/09/01 13:52:19 UTC

[1/2] git commit: updated refs/heads/master to c8bfeb8

Repository: cloudstack
Updated Branches:
  refs/heads/master 22c78ede3 -> c8bfeb88c


Support live migration on older version of Libvirt


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c5a0d5e0
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c5a0d5e0
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c5a0d5e0

Branch: refs/heads/master
Commit: c5a0d5e01c98a1a1915ea2d778baa2f30807f788
Parents: 1bbd23e
Author: Mike Tutkowski <mi...@solidfire.com>
Authored: Mon Aug 31 12:40:08 2015 -0600
Committer: Mike Tutkowski <mi...@solidfire.com>
Committed: Mon Aug 31 22:06:51 2015 -0600

----------------------------------------------------------------------
 .../resource/wrapper/LibvirtMigrateCommandWrapper.java |  6 +++++-
 .../kvm/resource/LibvirtComputingResourceTest.java     | 13 ++++++++++++-
 2 files changed, 17 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c5a0d5e0/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtMigrateCommandWrapper.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtMigrateCommandWrapper.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtMigrateCommandWrapper.java
index a6bb591..c1328aa 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtMigrateCommandWrapper.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/wrapper/LibvirtMigrateCommandWrapper.java
@@ -87,8 +87,12 @@ public final class LibvirtMigrateCommandWrapper extends CommandWrapper<MigrateCo
                 CVE-2015-3252: Get XML with sensitive information suitable for migration by using
                                VIR_DOMAIN_XML_MIGRATABLE flag (value = 8)
                                https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainXMLFlags
+
+                               Use VIR_DOMAIN_XML_SECURE (value = 1) prior to v1.0.0.
              */
-            xmlDesc = dm.getXMLDesc(8).replace(libvirtComputingResource.getPrivateIp(), command.getDestinationIp());
+            int xmlFlag = conn.getLibVirVersion() >= 1000000 ? 8 : 1; // 1000000 equals v1.0.0
+
+            xmlDesc = dm.getXMLDesc(xmlFlag).replace(libvirtComputingResource.getPrivateIp(), command.getDestinationIp());
 
             dconn = libvirtUtilitiesHelper.retrieveQemuConnection("qemu+tcp://" + command.getDestinationIp() + "/system");
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/c5a0d5e0/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtComputingResourceTest.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtComputingResourceTest.java b/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtComputingResourceTest.java
index 03d9f49..920c86a 100644
--- a/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtComputingResourceTest.java
+++ b/plugins/hypervisors/kvm/test/com/cloud/hypervisor/kvm/resource/LibvirtComputingResourceTest.java
@@ -1246,6 +1246,7 @@ public class LibvirtComputingResourceTest {
 
             when(libvirtComputingResource.getPrivateIp()).thenReturn("127.0.0.1");
             when(dm.getXMLDesc(8)).thenReturn("host_domain");
+            when(dm.getXMLDesc(1)).thenReturn("host_domain");
             when(dm.isPersistent()).thenReturn(1);
             doNothing().when(dm).undefine();
 
@@ -1273,10 +1274,20 @@ public class LibvirtComputingResourceTest {
         verify(libvirtComputingResource, times(1)).getDisks(conn, vmName);
         try {
             verify(conn, times(1)).domainLookupByName(vmName);
-            verify(dm, times(1)).getXMLDesc(8);
         } catch (final LibvirtException e) {
             fail(e.getMessage());
         }
+
+        try {
+            verify(dm, times(1)).getXMLDesc(8);
+        } catch (final Throwable t) {
+            try {
+                verify(dm, times(1)).getXMLDesc(1);
+            }
+            catch (final LibvirtException e) {
+                fail(e.getMessage());
+            }
+        }
     }
 
     @Test


[2/2] git commit: updated refs/heads/master to c8bfeb8

Posted by bh...@apache.org.
Merge pull request #767 from mike-tutkowski/CLOUDSTACK-8792

Support live migration on older version of Libvirthttps://issues.apache.org/jira/browse/CLOUDSTACK-8792

A flag being passed to Libvirt assumes v1.0.0 or later.

We need to put a check in the code to pass in a different flag if the version of Libvirt is < 1.0.0.

* pr/767:
  Support live migration on older version of Libvirt

Signed-off-by: Rohit Yadav <ro...@shapeblue.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/c8bfeb88
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/c8bfeb88
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/c8bfeb88

Branch: refs/heads/master
Commit: c8bfeb88c3a18794e8b1beb85bdac3baa860bdb0
Parents: 22c78ed c5a0d5e
Author: Rohit Yadav <ro...@shapeblue.com>
Authored: Tue Sep 1 17:21:59 2015 +0530
Committer: Rohit Yadav <ro...@shapeblue.com>
Committed: Tue Sep 1 17:21:59 2015 +0530

----------------------------------------------------------------------
 .../resource/wrapper/LibvirtMigrateCommandWrapper.java |  6 +++++-
 .../kvm/resource/LibvirtComputingResourceTest.java     | 13 ++++++++++++-
 2 files changed, 17 insertions(+), 2 deletions(-)
----------------------------------------------------------------------