Remove code instantiating filters on direct interfaces

Remove the code that instantiates network filters on direct type
of interfaces. The parser already does not accept it.
This commit is contained in:
Stefan Berger 2011-11-10 11:16:22 -05:00 committed by Stefan Berger
parent a132fb0925
commit c31d23a787
3 changed files with 2 additions and 27 deletions

View File

@ -135,7 +135,6 @@ uname_normalize (struct utsname *ut)
*/
int
qemuPhysIfaceConnect(virDomainDefPtr def,
virConnectPtr conn,
struct qemud_driver *driver,
virDomainNetDefPtr net,
virBitmapPtr qemuCaps,
@ -145,7 +144,6 @@ qemuPhysIfaceConnect(virDomainDefPtr def,
#if WITH_MACVTAP
char *res_ifname = NULL;
int vnet_hdr = 0;
int err;
if (qemuCapsGet(qemuCaps, QEMU_CAPS_VNET_HDR) &&
net->model && STREQ(net->model, "virtio"))
@ -165,28 +163,6 @@ qemuPhysIfaceConnect(virDomainDefPtr def,
net->ifname = res_ifname;
}
if (rc >=0 && driver->macFilter) {
if ((err = networkAllowMacOnPort(driver, net->ifname, net->mac))) {
virReportSystemError(err,
_("failed to add ebtables rule to allow MAC address on '%s'"),
net->ifname);
}
}
if (rc >= 0) {
if ((net->filter) && (net->ifname)) {
err = virDomainConfNWFilterInstantiate(conn, net);
if (err) {
VIR_FORCE_CLOSE(rc);
delMacvtap(net->ifname, net->mac,
virDomainNetGetActualDirectDev(net),
virDomainNetGetActualDirectMode(net),
virDomainNetGetActualDirectVirtPortProfile(net),
driver->stateDir);
VIR_FREE(net->ifname);
}
}
}
#else
(void)def;
(void)conn;
@ -4173,7 +4149,7 @@ qemuBuildCommandLine(virConnectPtr conn,
tapfd) >= sizeof(tapfd_name))
goto no_memory;
} else if (actualType == VIR_DOMAIN_NET_TYPE_DIRECT) {
int tapfd = qemuPhysIfaceConnect(def, conn, driver, net,
int tapfd = qemuPhysIfaceConnect(def, driver, net,
qemuCaps, vmop);
if (tapfd < 0)
goto error;

View File

@ -132,7 +132,6 @@ int qemuNetworkIfaceConnect(virDomainDefPtr def,
ATTRIBUTE_NONNULL(2);
int qemuPhysIfaceConnect(virDomainDefPtr def,
virConnectPtr conn,
struct qemud_driver *driver,
virDomainNetDefPtr net,
virBitmapPtr qemuCaps,

View File

@ -676,7 +676,7 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
if (qemuOpenVhostNet(vm->def, net, priv->qemuCaps, &vhostfd) < 0)
goto cleanup;
} else if (actualType == VIR_DOMAIN_NET_TYPE_DIRECT) {
if ((tapfd = qemuPhysIfaceConnect(vm->def, conn, driver, net,
if ((tapfd = qemuPhysIfaceConnect(vm->def, driver, net,
priv->qemuCaps,
VIR_VM_OP_CREATE)) < 0)
goto cleanup;