cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthon...@apache.org
Subject git commit: updated refs/heads/4.4 to 7cd4319
Date Tue, 08 Apr 2014 23:14:29 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.4 c2b74c453 -> 7cd4319ee


 Destroy unplugged VIFs before creating a VIF for a VM


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

Branch: refs/heads/4.4
Commit: 7cd4319eed309996ea016f293863bed4b2a872a9
Parents: c2b74c4
Author: Anthony Xu <anthony.xu@citrix.com>
Authored: Tue Apr 8 16:13:33 2014 -0700
Committer: Anthony Xu <anthony.xu@citrix.com>
Committed: Tue Apr 8 16:13:58 2014 -0700

----------------------------------------------------------------------
 .../com/cloud/hypervisor/xen/resource/CitrixResourceBase.java | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7cd4319e/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
index 90042ff..91b265b 100644
--- a/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xen/src/com/cloud/hypervisor/xen/resource/CitrixResourceBase.java
@@ -3947,6 +3947,13 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
             while (vifIter.hasNext()) {
                 VIF vif = vifIter.next();
                 try {
+                    String deviceId = vif.getDevice(conn);
+                    if(vm.getIsControlDomain(conn) || vif.getCurrentlyAttached(conn)) {
+                        usedDeviceNums.add(Integer.valueOf(deviceId));
+                    } else {
+                        s_logger.debug("Found unplugged VIF " + deviceId + " in VM " + vmName
+ " destroy it");
+                        vif.destroy(conn);
+                    }
                     usedDeviceNums.add(Integer.valueOf(vif.getDevice(conn)));
                 } catch (NumberFormatException e) {
                     String msg = "Obtained an invalid value for an allocated VIF device number
for VM: " + vmName;


Mime
View raw message