*/
int
qemuPhysIfaceConnect(virDomainDefPtr def,
- virConnectPtr conn,
struct qemud_driver *driver,
virDomainNetDefPtr net,
virBitmapPtr qemuCaps,
#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"))
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;
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;
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;