mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-24 05:25:18 +00:00
qemuBuildInterfaceCommandLine: Remove 'tapfd' infrastructure
Signed-off-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
7a38d3946b
commit
822a6dfc07
@ -8790,15 +8790,11 @@ qemuBuildInterfaceCommandLine(virQEMUDriver *driver,
|
|||||||
int ret = -1;
|
int ret = -1;
|
||||||
g_autoptr(virJSONValue) nicprops = NULL;
|
g_autoptr(virJSONValue) nicprops = NULL;
|
||||||
g_autofree char *nic = NULL;
|
g_autofree char *nic = NULL;
|
||||||
int *tapfd = NULL;
|
|
||||||
size_t tapfdSize = 0;
|
|
||||||
char **tapfdName = NULL;
|
|
||||||
g_autofree char *slirpfdName = NULL;
|
g_autofree char *slirpfdName = NULL;
|
||||||
virDomainNetType actualType = virDomainNetGetActualType(net);
|
virDomainNetType actualType = virDomainNetGetActualType(net);
|
||||||
const virNetDevBandwidth *actualBandwidth;
|
const virNetDevBandwidth *actualBandwidth;
|
||||||
bool requireNicdev = false;
|
bool requireNicdev = false;
|
||||||
qemuSlirp *slirp;
|
qemuSlirp *slirp;
|
||||||
size_t i;
|
|
||||||
g_autoptr(virJSONValue) hostnetprops = NULL;
|
g_autoptr(virJSONValue) hostnetprops = NULL;
|
||||||
qemuDomainNetworkPrivate *netpriv = QEMU_DOMAIN_NETWORK_PRIVATE(net);
|
qemuDomainNetworkPrivate *netpriv = QEMU_DOMAIN_NETWORK_PRIVATE(net);
|
||||||
GSList *n;
|
GSList *n;
|
||||||
@ -8932,17 +8928,6 @@ qemuBuildInterfaceCommandLine(virQEMUDriver *driver,
|
|||||||
slirpfdName = g_strdup_printf("%d", slirpfd);
|
slirpfdName = g_strdup_printf("%d", slirpfd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
for (i = 0; i < tapfdSize; i++) {
|
|
||||||
if (qemuSecuritySetTapFDLabel(driver->securityManager,
|
|
||||||
def, tapfd[i]) < 0)
|
|
||||||
goto cleanup;
|
|
||||||
tapfdName[i] = g_strdup_printf("%d", tapfd[i]);
|
|
||||||
virCommandPassFD(cmd, tapfd[i],
|
|
||||||
VIR_COMMAND_PASS_FD_CLOSE_PARENT);
|
|
||||||
tapfd[i] = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
for (n = netpriv->tapfds; n; n = n->next) {
|
for (n = netpriv->tapfds; n; n = n->next) {
|
||||||
if (qemuFDPassTransferCommand(n->data, cmd) < 0)
|
if (qemuFDPassTransferCommand(n->data, cmd) < 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -8957,7 +8942,7 @@ qemuBuildInterfaceCommandLine(virQEMUDriver *driver,
|
|||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
if (!(hostnetprops = qemuBuildHostNetProps(net,
|
if (!(hostnetprops = qemuBuildHostNetProps(net,
|
||||||
tapfdName, tapfdSize,
|
NULL, 0,
|
||||||
slirpfdName)))
|
slirpfdName)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
@ -9002,14 +8987,6 @@ qemuBuildInterfaceCommandLine(virQEMUDriver *driver,
|
|||||||
virDomainConfNWFilterTeardown(net);
|
virDomainConfNWFilterTeardown(net);
|
||||||
virErrorRestore(&saved_err);
|
virErrorRestore(&saved_err);
|
||||||
}
|
}
|
||||||
for (i = 0; tapfd && i < tapfdSize; i++) {
|
|
||||||
if (ret < 0)
|
|
||||||
VIR_FORCE_CLOSE(tapfd[i]);
|
|
||||||
if (tapfdName)
|
|
||||||
VIR_FREE(tapfdName[i]);
|
|
||||||
}
|
|
||||||
VIR_FREE(tapfdName);
|
|
||||||
VIR_FREE(tapfd);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user