#include "virnetdev.h"
#include "virnetdevbridge.h"
#include "virnetdevtap.h"
+#include "virnetdevmidonet.h"
#include "device_conf.h"
#include "virstoragefile.h"
#include "virstring.h"
}
vport = virDomainNetGetActualVirtPortProfile(net);
- if (vport && vport->virtPortType == VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH)
- ignore_value(virNetDevOpenvswitchRemovePort(
- virDomainNetGetActualBridgeName(net), net->ifname));
+ if (vport) {
+ if (vport->virtPortType == VIR_NETDEV_VPORT_PROFILE_MIDONET) {
+ ignore_value(virNetDevMidonetUnbindPort(vport));
+ } else if (vport->virtPortType == VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH) {
+ ignore_value(virNetDevOpenvswitchRemovePort(
+ virDomainNetGetActualBridgeName(net),
+ net->ifname));
+ }
+ }
}
virDomainNetRemoveHostdev(vm->def, net);
}
vport = virDomainNetGetActualVirtPortProfile(net);
- if (vport && vport->virtPortType == VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH)
- ignore_value(virNetDevOpenvswitchRemovePort(
- virDomainNetGetActualBridgeName(net),
- net->ifname));
+ if (vport) {
+ if (vport->virtPortType == VIR_NETDEV_VPORT_PROFILE_MIDONET) {
+ ignore_value(virNetDevMidonetUnbindPort(vport));
+ } else if (vport->virtPortType == VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH) {
+ ignore_value(virNetDevOpenvswitchRemovePort(
+ virDomainNetGetActualBridgeName(net),
+ net->ifname));
+ }
+ }
networkReleaseActualDevice(vm->def, net);
virDomainNetDefFree(net);
#include "virprocess.h"
#include "virtime.h"
#include "virnetdevtap.h"
+#include "virnetdevmidonet.h"
#include "virbitmap.h"
#include "viratomic.h"
#include "virnuma.h"
/* release the physical device (or any other resources used by
* this interface in the network driver
*/
- if (vport && vport->virtPortType == VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH)
- ignore_value(virNetDevOpenvswitchRemovePort(
- virDomainNetGetActualBridgeName(net),
- net->ifname));
+ if (vport) {
+ if (vport->virtPortType == VIR_NETDEV_VPORT_PROFILE_MIDONET) {
+ ignore_value(virNetDevMidonetUnbindPort(vport));
+ } else if (vport->virtPortType == VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH) {
+ ignore_value(virNetDevOpenvswitchRemovePort(
+ virDomainNetGetActualBridgeName(net),
+ net->ifname));
+ }
+ }
/* kick the device out of the hostdev list too */
virDomainNetRemoveHostdev(def, net);
#include "virnetdevtap.h"
#include "virnetdev.h"
#include "virnetdevbridge.h"
+#include "virnetdevmidonet.h"
#include "virnetdevopenvswitch.h"
#include "virerror.h"
#include "virfile.h"
goto error;
if (virtPortProfile) {
- if (virNetDevOpenvswitchAddPort(brname, *ifname, macaddr, vmuuid,
- virtPortProfile, virtVlan) < 0) {
- goto error;
+ if (virtPortProfile->virtPortType == VIR_NETDEV_VPORT_PROFILE_MIDONET) {
+ if (virNetDevMidonetBindPort(*ifname, virtPortProfile) < 0)
+ goto error;
+ } else if (virtPortProfile->virtPortType == VIR_NETDEV_VPORT_PROFILE_OPENVSWITCH) {
+ if (virNetDevOpenvswitchAddPort(brname, *ifname, macaddr, vmuuid,
+ virtPortProfile, virtVlan) < 0)
+ goto error;
}
} else {
if (virNetDevBridgeAddPort(brname, *ifname) < 0)