cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mlsoren...@apache.org
Subject git commit: updated refs/heads/master to 6ca4e3a
Date Fri, 25 Apr 2014 00:58:58 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 1d45b7529 -> 6ca4e3acb


CLOUDSTACK-6500: Make KVM agent aware of rootDiskController
    and nicAdapter parameters passed in StartCommand, provided
    by template details


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

Branch: refs/heads/master
Commit: 6ca4e3acb654756d1af0f56bf40bd49db02f7a24
Parents: 1d45b75
Author: Marcus Sorensen <marcus@betterservers.com>
Authored: Thu Apr 24 19:01:33 2014 -0600
Committer: Marcus Sorensen <marcus@betterservers.com>
Committed: Thu Apr 24 19:01:33 2014 -0600

----------------------------------------------------------------------
 .../kvm/resource/BridgeVifDriver.java           | 23 ++++++------
 .../kvm/resource/DirectVifDriver.java           |  6 ++--
 .../kvm/resource/LibvirtComputingResource.java  | 37 ++++++++++++++++----
 .../hypervisor/kvm/resource/OvsVifDriver.java   | 22 ++++++------
 .../hypervisor/kvm/resource/VifDriver.java      |  2 +-
 .../hypervisor/kvm/resource/VifDriverBase.java  | 13 +++++--
 .../network/resource/MidoNetVifDriver.java      |  4 +--
 7 files changed, 71 insertions(+), 36 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6ca4e3ac/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java
index 57b111e..c99de7a 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/BridgeVifDriver.java
@@ -82,10 +82,13 @@ public class BridgeVifDriver extends VifDriverBase {
     }
 
     @Override
-    public LibvirtVMDef.InterfaceDef plug(NicTO nic, String guestOsType) throws InternalErrorException,
LibvirtException {
+    public LibvirtVMDef.InterfaceDef plug(NicTO nic, String guestOsType, String nicAdapter)
throws InternalErrorException, LibvirtException {
 
         if (s_logger.isDebugEnabled()) {
             s_logger.debug("nic=" + nic);
+            if (nicAdapter != null && !nicAdapter.isEmpty()) {
+                s_logger.debug("custom nic adapter=" + nicAdapter);
+            }
         }
 
         LibvirtVMDef.InterfaceDef intf = new LibvirtVMDef.InterfaceDef();
@@ -106,18 +109,18 @@ public class BridgeVifDriver extends VifDriverBase {
                 if (trafficLabel != null && !trafficLabel.isEmpty()) {
                     s_logger.debug("creating a vNet dev and bridge for guest traffic per
traffic label " + trafficLabel);
                     String brName = createVnetBr(vNetId, trafficLabel, protocol);
-                    intf.defBridgeNet(brName, null, nic.getMac(), getGuestNicModel(guestOsType),
networkRateKBps);
+                    intf.defBridgeNet(brName, null, nic.getMac(), getGuestNicModel(guestOsType,
nicAdapter), networkRateKBps);
                 } else {
                     String brName = createVnetBr(vNetId, "private", protocol);
-                    intf.defBridgeNet(brName, null, nic.getMac(), getGuestNicModel(guestOsType),
networkRateKBps);
+                    intf.defBridgeNet(brName, null, nic.getMac(), getGuestNicModel(guestOsType,
nicAdapter), networkRateKBps);
                 }
             } else {
-                intf.defBridgeNet(_bridges.get("guest"), null, nic.getMac(), getGuestNicModel(guestOsType),
networkRateKBps);
+                intf.defBridgeNet(_bridges.get("guest"), null, nic.getMac(), getGuestNicModel(guestOsType,
nicAdapter), networkRateKBps);
             }
         } else if (nic.getType() == Networks.TrafficType.Control) {
             /* Make sure the network is still there */
             createControlNetwork();
-            intf.defBridgeNet(_bridges.get("linklocal"), null, nic.getMac(), getGuestNicModel(guestOsType));
+            intf.defBridgeNet(_bridges.get("linklocal"), null, nic.getMac(), getGuestNicModel(guestOsType,
nicAdapter));
         } else if (nic.getType() == Networks.TrafficType.Public) {
             Integer networkRateKBps = (nic.getNetworkRateMbps() != null && nic.getNetworkRateMbps().intValue()
!= -1) ? nic.getNetworkRateMbps().intValue() * 128 : 0;
             if (nic.getBroadcastType() == Networks.BroadcastDomainType.Vlan && !vNetId.equalsIgnoreCase("untagged")
||
@@ -125,19 +128,19 @@ public class BridgeVifDriver extends VifDriverBase {
                 if (trafficLabel != null && !trafficLabel.isEmpty()) {
                     s_logger.debug("creating a vNet dev and bridge for public traffic per
traffic label " + trafficLabel);
                     String brName = createVnetBr(vNetId, trafficLabel, protocol);
-                    intf.defBridgeNet(brName, null, nic.getMac(), getGuestNicModel(guestOsType),
networkRateKBps);
+                    intf.defBridgeNet(brName, null, nic.getMac(), getGuestNicModel(guestOsType,
nicAdapter), networkRateKBps);
                 } else {
                     String brName = createVnetBr(vNetId, "public", protocol);
-                    intf.defBridgeNet(brName, null, nic.getMac(), getGuestNicModel(guestOsType),
networkRateKBps);
+                    intf.defBridgeNet(brName, null, nic.getMac(), getGuestNicModel(guestOsType,
nicAdapter), networkRateKBps);
                 }
             } else {
-                intf.defBridgeNet(_bridges.get("public"), null, nic.getMac(), getGuestNicModel(guestOsType),
networkRateKBps);
+                intf.defBridgeNet(_bridges.get("public"), null, nic.getMac(), getGuestNicModel(guestOsType,
nicAdapter), networkRateKBps);
             }
         } else if (nic.getType() == Networks.TrafficType.Management) {
-            intf.defBridgeNet(_bridges.get("private"), null, nic.getMac(), getGuestNicModel(guestOsType));
+            intf.defBridgeNet(_bridges.get("private"), null, nic.getMac(), getGuestNicModel(guestOsType,
nicAdapter));
         } else if (nic.getType() == Networks.TrafficType.Storage) {
             String storageBrName = nic.getName() == null ? _bridges.get("private") : nic.getName();
-            intf.defBridgeNet(storageBrName, null, nic.getMac(), getGuestNicModel(guestOsType));
+            intf.defBridgeNet(storageBrName, null, nic.getMac(), getGuestNicModel(guestOsType,
nicAdapter));
         }
         return intf;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6ca4e3ac/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/DirectVifDriver.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/DirectVifDriver.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/DirectVifDriver.java
index 4e1633a..3cc8839 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/DirectVifDriver.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/DirectVifDriver.java
@@ -41,17 +41,17 @@ public class DirectVifDriver extends VifDriverBase {
      * @throws LibvirtException
      */
     @Override
-    public LibvirtVMDef.InterfaceDef plug(NicTO nic, String guestOsType) throws InternalErrorException,
LibvirtException {
+    public LibvirtVMDef.InterfaceDef plug(NicTO nic, String guestOsType, String nicAdapter)
throws InternalErrorException, LibvirtException {
         LibvirtVMDef.InterfaceDef intf = new LibvirtVMDef.InterfaceDef();
 
         if (nic.getType() == Networks.TrafficType.Guest) {
             Integer networkRateKBps = (nic.getNetworkRateMbps() != null && nic.getNetworkRateMbps().intValue()
!= -1) ? nic.getNetworkRateMbps().intValue() * 128 : 0;
-            intf.defDirectNet(_libvirtComputingResource.getNetworkDirectDevice(), null, nic.getMac(),
getGuestNicModel(guestOsType),
+            intf.defDirectNet(_libvirtComputingResource.getNetworkDirectDevice(), null, nic.getMac(),
getGuestNicModel(guestOsType, nicAdapter),
                 _libvirtComputingResource.getNetworkDirectSourceMode(), networkRateKBps);
 
         } else if (nic.getType() == Networks.TrafficType.Public) {
             Integer networkRateKBps = (nic.getNetworkRateMbps() != null && nic.getNetworkRateMbps().intValue()
!= -1) ? nic.getNetworkRateMbps().intValue() * 128 : 0;
-            intf.defDirectNet(_libvirtComputingResource.getNetworkDirectDevice(), null, nic.getMac(),
getGuestNicModel(guestOsType),
+            intf.defDirectNet(_libvirtComputingResource.getNetworkDirectDevice(), null, nic.getMac(),
getGuestNicModel(guestOsType, nicAdapter),
                 _libvirtComputingResource.getNetworkDirectSourceMode(), networkRateKBps);
         }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6ca4e3ac/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 2a3fcbe..1fd30cf 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
@@ -2007,7 +2007,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements
Serv
         }
 
         Domain vm = getDomain(conn, vmName);
-        vm.attachDevice(getVifDriver(nicTO.getType()).plug(nicTO, "Other PV (32-bit)").toString());
+        vm.attachDevice(getVifDriver(nicTO.getType()).plug(nicTO, "Other PV (32-bit)", "").toString());
     }
 
 
@@ -2044,7 +2044,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements
Serv
                 }
                 nicnum++;
             }
-            vm.attachDevice(getVifDriver(nic.getType()).plug(nic, "Other PV (32-bit)").toString());
+            vm.attachDevice(getVifDriver(nic.getType()).plug(nic, "Other PV (32-bit)", "").toString());
             return new PlugNicAnswer(cmd, true, "success");
         } catch (LibvirtException e) {
             String msg = " Plug Nic failed due to " + e.toString();
@@ -3211,7 +3211,7 @@ public class LibvirtComputingResource extends ServerResourceBase implements
Serv
         try {
             Connect conn = LibvirtConnection.getConnectionByVmName(vm.getName());
             for (NicTO nic : nics) {
-                getVifDriver(nic.getType()).plug(nic, null);
+                getVifDriver(nic.getType()).plug(nic, null, "");
             }
 
             /* setup disks, e.g for iso */
@@ -3758,10 +3758,15 @@ public class LibvirtComputingResource extends ServerResourceBase implements
Serv
 
     protected void createVifs(VirtualMachineTO vmSpec, LibvirtVMDef vm) throws InternalErrorException,
LibvirtException {
         NicTO[] nics = vmSpec.getNics();
+        Map <String, String> params = vmSpec.getDetails();
+        String nicAdapter = "";
+        if (params != null && params.get("nicAdapter") != null && !params.get("nicAdapter").isEmpty())
{
+            nicAdapter = params.get("nicAdapter");
+        }
         for (int i = 0; i < nics.length; i++) {
             for (NicTO nic : vmSpec.getNics()) {
                 if (nic.getDeviceId() == i) {
-                    createVif(vm, nic);
+                    createVif(vm, nic, nicAdapter);
                 }
             }
         }
@@ -3925,7 +3930,25 @@ public class LibvirtComputingResource extends ServerResourceBase implements
Serv
                 volPath = physicalDisk.getPath();
             }
 
-            DiskDef.diskBus diskBusType = getGuestDiskModel(vmSpec.getOs());
+            // if params contains a rootDiskController key, use its value (this is what other
HVs are doing)
+            DiskDef.diskBus diskBusType = null;
+            Map <String, String> params = vmSpec.getDetails();
+            if (params != null && params.get("rootDiskController") != null &&
!params.get("rootDiskController").isEmpty()) {
+                String rootDiskController = params.get("rootDiskController");
+                s_logger.debug("Passed custom disk bus " + rootDiskController);
+                for (DiskDef.diskBus bus : DiskDef.diskBus.values()) {
+                    if (bus.toString().equalsIgnoreCase(rootDiskController)) {
+                        s_logger.debug("Found matching enum for disk bus " + rootDiskController);
+                        diskBusType = bus;
+                        break;
+                    }
+                }
+            }
+
+            if (diskBusType == null) {
+                diskBusType = getGuestDiskModel(vmSpec.getOs());
+            }
+
             DiskDef disk = new DiskDef();
             if (volume.getType() == Volume.Type.ISO) {
                 if (volPath == null) {
@@ -4004,8 +4027,8 @@ public class LibvirtComputingResource extends ServerResourceBase implements
Serv
 
     }
 
-    private void createVif(LibvirtVMDef vm, NicTO nic) throws InternalErrorException, LibvirtException
{
-        vm.getDevices().addDevice(getVifDriver(nic.getType()).plug(nic, vm.getGuestOSType()).toString());
+    private void createVif(LibvirtVMDef vm, NicTO nic, String nicAdapter) throws InternalErrorException,
LibvirtException {
+        vm.getDevices().addDevice(getVifDriver(nic.getType()).plug(nic, vm.getGuestOSType(),
nicAdapter).toString());
     }
 
     protected CheckSshAnswer execute(CheckSshCommand cmd) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6ca4e3ac/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/OvsVifDriver.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/OvsVifDriver.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/OvsVifDriver.java
index c64a472..70754d0 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/OvsVifDriver.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/OvsVifDriver.java
@@ -54,7 +54,7 @@ public class OvsVifDriver extends VifDriverBase {
     }
 
     @Override
-    public InterfaceDef plug(NicTO nic, String guestOsType) throws InternalErrorException,
LibvirtException {
+    public InterfaceDef plug(NicTO nic, String guestOsType, String nicAdapter) throws InternalErrorException,
LibvirtException {
         s_logger.debug("plugging nic=" + nic);
 
         LibvirtVMDef.InterfaceDef intf = new LibvirtVMDef.InterfaceDef();
@@ -77,43 +77,43 @@ public class OvsVifDriver extends VifDriverBase {
                     !vlanId.equalsIgnoreCase("untagged")) {
                 if (trafficLabel != null && !trafficLabel.isEmpty()) {
                     s_logger.debug("creating a vlan dev and bridge for guest traffic per
traffic label " + trafficLabel);
-                    intf.defBridgeNet(_pifs.get(trafficLabel), null, nic.getMac(), getGuestNicModel(guestOsType),
networkRateKBps);
+                    intf.defBridgeNet(_pifs.get(trafficLabel), null, nic.getMac(), getGuestNicModel(guestOsType,
nicAdapter), networkRateKBps);
                     intf.setVlanTag(Integer.parseInt(vlanId));
                 } else {
-                    intf.defBridgeNet(_pifs.get("private"), null, nic.getMac(), getGuestNicModel(guestOsType),
networkRateKBps);
+                    intf.defBridgeNet(_pifs.get("private"), null, nic.getMac(), getGuestNicModel(guestOsType,
nicAdapter), networkRateKBps);
                     intf.setVlanTag(Integer.parseInt(vlanId));
                 }
             } else if (nic.getBroadcastType() == Networks.BroadcastDomainType.Lswitch ||
nic.getBroadcastType() == Networks.BroadcastDomainType.OpenDaylight) {
                 s_logger.debug("nic " + nic + " needs to be connected to LogicalSwitch "
+ logicalSwitchUuid);
                 intf.setVirtualPortInterfaceId(nic.getUuid());
                 String brName = (trafficLabel != null && !trafficLabel.isEmpty())
? _pifs.get(trafficLabel) : _pifs.get("private");
-                intf.defBridgeNet(brName, null, nic.getMac(), getGuestNicModel(guestOsType),
networkRateKBps);
+                intf.defBridgeNet(brName, null, nic.getMac(), getGuestNicModel(guestOsType,
nicAdapter), networkRateKBps);
             } else {
-                intf.defBridgeNet(_bridges.get("guest"), null, nic.getMac(), getGuestNicModel(guestOsType),
networkRateKBps);
+                intf.defBridgeNet(_bridges.get("guest"), null, nic.getMac(), getGuestNicModel(guestOsType,
nicAdapter), networkRateKBps);
             }
         } else if (nic.getType() == Networks.TrafficType.Control) {
             /* Make sure the network is still there */
             createControlNetwork(_bridges.get("linklocal"));
-            intf.defBridgeNet(_bridges.get("linklocal"), null, nic.getMac(), getGuestNicModel(guestOsType));
+            intf.defBridgeNet(_bridges.get("linklocal"), null, nic.getMac(), getGuestNicModel(guestOsType,
nicAdapter));
         } else if (nic.getType() == Networks.TrafficType.Public) {
             Integer networkRateKBps = (nic.getNetworkRateMbps() != null && nic.getNetworkRateMbps().intValue()
!= -1) ? nic.getNetworkRateMbps().intValue() * 128 : 0;
             if (nic.getBroadcastType() == Networks.BroadcastDomainType.Vlan && !vlanId.equalsIgnoreCase("untagged"))
{
                 if (trafficLabel != null && !trafficLabel.isEmpty()) {
                     s_logger.debug("creating a vlan dev and bridge for public traffic per
traffic label " + trafficLabel);
-                    intf.defBridgeNet(_pifs.get(trafficLabel), null, nic.getMac(), getGuestNicModel(guestOsType),
networkRateKBps);
+                    intf.defBridgeNet(_pifs.get(trafficLabel), null, nic.getMac(), getGuestNicModel(guestOsType,
nicAdapter), networkRateKBps);
                     intf.setVlanTag(Integer.parseInt(vlanId));
                 } else {
-                    intf.defBridgeNet(_pifs.get("public"), null, nic.getMac(), getGuestNicModel(guestOsType),
networkRateKBps);
+                    intf.defBridgeNet(_pifs.get("public"), null, nic.getMac(), getGuestNicModel(guestOsType,
nicAdapter), networkRateKBps);
                     intf.setVlanTag(Integer.parseInt(vlanId));
                 }
             } else {
-                intf.defBridgeNet(_bridges.get("public"), null, nic.getMac(), getGuestNicModel(guestOsType),
networkRateKBps);
+                intf.defBridgeNet(_bridges.get("public"), null, nic.getMac(), getGuestNicModel(guestOsType,
nicAdapter), networkRateKBps);
             }
         } else if (nic.getType() == Networks.TrafficType.Management) {
-            intf.defBridgeNet(_bridges.get("private"), null, nic.getMac(), getGuestNicModel(guestOsType));
+            intf.defBridgeNet(_bridges.get("private"), null, nic.getMac(), getGuestNicModel(guestOsType,
nicAdapter));
         } else if (nic.getType() == Networks.TrafficType.Storage) {
             String storageBrName = nic.getName() == null ? _bridges.get("private") : nic.getName();
-            intf.defBridgeNet(storageBrName, null, nic.getMac(), getGuestNicModel(guestOsType));
+            intf.defBridgeNet(storageBrName, null, nic.getMac(), getGuestNicModel(guestOsType,
nicAdapter));
         }
         return intf;
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6ca4e3ac/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/VifDriver.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/VifDriver.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/VifDriver.java
index dc77a2e..5cd2d61 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/VifDriver.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/VifDriver.java
@@ -32,7 +32,7 @@ public interface VifDriver {
 
     public void configure(Map<String, Object> params) throws ConfigurationException;
 
-    public LibvirtVMDef.InterfaceDef plug(NicTO nic, String guestOsType) throws InternalErrorException,
LibvirtException;
+    public LibvirtVMDef.InterfaceDef plug(NicTO nic, String guestOsType, String nicAdapter)
throws InternalErrorException, LibvirtException;
 
     public void unplug(LibvirtVMDef.InterfaceDef iface);
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6ca4e3ac/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/VifDriverBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/VifDriverBase.java
b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/VifDriverBase.java
index d89d71a..f41dc56 100644
--- a/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/VifDriverBase.java
+++ b/plugins/hypervisors/kvm/src/com/cloud/hypervisor/kvm/resource/VifDriverBase.java
@@ -42,12 +42,21 @@ public abstract class VifDriverBase implements VifDriver {
     }
 
     @Override
-    public abstract LibvirtVMDef.InterfaceDef plug(NicTO nic, String guestOsType) throws
InternalErrorException, LibvirtException;
+    public abstract LibvirtVMDef.InterfaceDef plug(NicTO nic, String guestOsType, String
nicAdapter) throws InternalErrorException, LibvirtException;
 
     @Override
     public abstract void unplug(LibvirtVMDef.InterfaceDef iface);
 
-    protected LibvirtVMDef.InterfaceDef.nicModel getGuestNicModel(String guestOSType) {
+    protected LibvirtVMDef.InterfaceDef.nicModel getGuestNicModel(String guestOSType, String
nicAdapter) {
+        // if nicAdapter is found in ENUM, use it. Otherwise, match guest OS type as before
+        if (nicAdapter != null && !nicAdapter.isEmpty()) {
+            for (LibvirtVMDef.InterfaceDef.nicModel model : LibvirtVMDef.InterfaceDef.nicModel.values())
{
+                if (model.toString().equalsIgnoreCase(nicAdapter)) {
+                    return model;
+                }
+            }
+        }
+
         if (_libvirtComputingResource.isGuestPVEnabled(guestOSType)) {
             return LibvirtVMDef.InterfaceDef.nicModel.VIRTIO;
         } else {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6ca4e3ac/plugins/network-elements/midonet/src/com/cloud/network/resource/MidoNetVifDriver.java
----------------------------------------------------------------------
diff --git a/plugins/network-elements/midonet/src/com/cloud/network/resource/MidoNetVifDriver.java
b/plugins/network-elements/midonet/src/com/cloud/network/resource/MidoNetVifDriver.java
index fd2b5ed..c3185f5 100644
--- a/plugins/network-elements/midonet/src/com/cloud/network/resource/MidoNetVifDriver.java
+++ b/plugins/network-elements/midonet/src/com/cloud/network/resource/MidoNetVifDriver.java
@@ -103,7 +103,7 @@ public class MidoNetVifDriver extends VifDriverBase {
     }
 
     @Override
-    public LibvirtVMDef.InterfaceDef plug(NicTO nic, String guestOsType) throws InternalErrorException,
LibvirtException {
+    public LibvirtVMDef.InterfaceDef plug(NicTO nic, String guestOsType, String nicAdapter)
throws InternalErrorException, LibvirtException {
 
         if (s_logger.isDebugEnabled()) {
             s_logger.debug("nic=" + nic);
@@ -146,7 +146,7 @@ public class MidoNetVifDriver extends VifDriverBase {
                 }
             }
 
-            intf.defEthernet(tapName, nic.getMac(), getGuestNicModel(guestOsType), "");
+            intf.defEthernet(tapName, nic.getMac(), getGuestNicModel(guestOsType, nicAdapter),
"");
 
         } else {
             throw new InternalErrorException("Only NICs of BroadcastDomain type Mido are
supported by the MidoNetVifDriver");


Mime
View raw message