You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by ed...@apache.org on 2012/10/29 19:37:06 UTC

[2/2] git commit: kvm agent NIC unplug will always fail

kvm agent NIC unplug will always fail

On kvm computing host, vifdriver.unplug will always fails (throws
LibvirtException) and network cleanup will not be called. This was
because the code first undefine the computing domain, and then tries to
query the destroyed machine definition to fetch NIC information. IMHO,
kvm plugin code rounds LibvirtException too much.

Signed-off-by: Edison Su <su...@gmail.com>


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

Branch: refs/heads/master
Commit: cb9395498f5e09c37b25fd16b338d021dc845bff
Parents: ce60cfe
Author: Hiroaki Kawai <ka...@stratosphere.co.jp>
Authored: Mon Oct 29 11:35:49 2012 -0700
Committer: Edison Su <su...@gmail.com>
Committed: Mon Oct 29 11:35:49 2012 -0700

----------------------------------------------------------------------
 .../kvm/resource/LibvirtComputingResource.java     |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/cb939549/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
index 1bc70fa..fe2c83a 100755
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/LibvirtComputingResource.java
@@ -2584,6 +2584,8 @@ public class LibvirtComputingResource extends ServerResourceBase implements
             Connect conn = LibvirtConnection.getConnection();
 
             List<DiskDef> disks = getDisks(conn, vmName);
+            List<InterfaceDef> ifaces = getInterfaces(conn, vmName);
+
             destroy_network_rules_for_vm(conn, vmName);
             String result = stopVM(conn, vmName, defineOps.UNDEFINE_VM);
             if (result == null) {
@@ -2599,11 +2601,9 @@ public class LibvirtComputingResource extends ServerResourceBase implements
                         }
                     }
                 }
-            }
-
-            List<InterfaceDef> ifaces = getInterfaces(conn, vmName);
-            for(InterfaceDef iface: ifaces){
-                _vifDriver.unplug(iface);
+                for (InterfaceDef iface: ifaces) {
+                    _vifDriver.unplug(iface);
+                }
             }
 
             final String result2 = cleanupVnet(conn, cmd.getVnet());