mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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:
parent
a132fb0925
commit
c31d23a787
@ -135,7 +135,6 @@ uname_normalize (struct utsname *ut)
|
|||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
qemuPhysIfaceConnect(virDomainDefPtr def,
|
qemuPhysIfaceConnect(virDomainDefPtr def,
|
||||||
virConnectPtr conn,
|
|
||||||
struct qemud_driver *driver,
|
struct qemud_driver *driver,
|
||||||
virDomainNetDefPtr net,
|
virDomainNetDefPtr net,
|
||||||
virBitmapPtr qemuCaps,
|
virBitmapPtr qemuCaps,
|
||||||
@ -145,7 +144,6 @@ qemuPhysIfaceConnect(virDomainDefPtr def,
|
|||||||
#if WITH_MACVTAP
|
#if WITH_MACVTAP
|
||||||
char *res_ifname = NULL;
|
char *res_ifname = NULL;
|
||||||
int vnet_hdr = 0;
|
int vnet_hdr = 0;
|
||||||
int err;
|
|
||||||
|
|
||||||
if (qemuCapsGet(qemuCaps, QEMU_CAPS_VNET_HDR) &&
|
if (qemuCapsGet(qemuCaps, QEMU_CAPS_VNET_HDR) &&
|
||||||
net->model && STREQ(net->model, "virtio"))
|
net->model && STREQ(net->model, "virtio"))
|
||||||
@ -165,28 +163,6 @@ qemuPhysIfaceConnect(virDomainDefPtr def,
|
|||||||
net->ifname = res_ifname;
|
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
|
#else
|
||||||
(void)def;
|
(void)def;
|
||||||
(void)conn;
|
(void)conn;
|
||||||
@ -4173,7 +4149,7 @@ qemuBuildCommandLine(virConnectPtr conn,
|
|||||||
tapfd) >= sizeof(tapfd_name))
|
tapfd) >= sizeof(tapfd_name))
|
||||||
goto no_memory;
|
goto no_memory;
|
||||||
} else if (actualType == VIR_DOMAIN_NET_TYPE_DIRECT) {
|
} else if (actualType == VIR_DOMAIN_NET_TYPE_DIRECT) {
|
||||||
int tapfd = qemuPhysIfaceConnect(def, conn, driver, net,
|
int tapfd = qemuPhysIfaceConnect(def, driver, net,
|
||||||
qemuCaps, vmop);
|
qemuCaps, vmop);
|
||||||
if (tapfd < 0)
|
if (tapfd < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
@ -132,7 +132,6 @@ int qemuNetworkIfaceConnect(virDomainDefPtr def,
|
|||||||
ATTRIBUTE_NONNULL(2);
|
ATTRIBUTE_NONNULL(2);
|
||||||
|
|
||||||
int qemuPhysIfaceConnect(virDomainDefPtr def,
|
int qemuPhysIfaceConnect(virDomainDefPtr def,
|
||||||
virConnectPtr conn,
|
|
||||||
struct qemud_driver *driver,
|
struct qemud_driver *driver,
|
||||||
virDomainNetDefPtr net,
|
virDomainNetDefPtr net,
|
||||||
virBitmapPtr qemuCaps,
|
virBitmapPtr qemuCaps,
|
||||||
|
@ -676,7 +676,7 @@ int qemuDomainAttachNetDevice(virConnectPtr conn,
|
|||||||
if (qemuOpenVhostNet(vm->def, net, priv->qemuCaps, &vhostfd) < 0)
|
if (qemuOpenVhostNet(vm->def, net, priv->qemuCaps, &vhostfd) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
} else if (actualType == VIR_DOMAIN_NET_TYPE_DIRECT) {
|
} 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,
|
priv->qemuCaps,
|
||||||
VIR_VM_OP_CREATE)) < 0)
|
VIR_VM_OP_CREATE)) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
Reference in New Issue
Block a user