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/master to 8f9d87c
Date Tue, 08 Apr 2014 23:21:45 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master ad60eed4a -> 8f9d87c6d


 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/8f9d87c6
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/8f9d87c6
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/8f9d87c6

Branch: refs/heads/master
Commit: 8f9d87c6d978461c14de527376cdb9401d6b7847
Parents: ad60eed
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:15:06 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/8f9d87c6/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