qemuMonitorAddNetdev: Remove unused 'tapfd' infrastructure

All callers pass NULL/0.

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:
Peter Krempa 2022-05-10 15:55:13 +02:00
parent c0d25738b2
commit 13ae2e2e30
3 changed files with 3 additions and 16 deletions

View File

@ -1414,7 +1414,6 @@ qemuDomainAttachNetDevice(virQEMUDriver *driver,
}
if (qemuMonitorAddNetdev(priv->mon, &netprops,
NULL, NULL, 0,
slirpfd, slirpfdName) < 0) {
qemuDomainObjExitMonitor(vm);
virDomainAuditNet(vm, NULL, net, "attach", false);
@ -2185,7 +2184,7 @@ qemuDomainAttachChrDevice(virQEMUDriver *driver,
if (netdevprops) {
if (qemuMonitorAddNetdev(priv->mon, &netdevprops,
NULL, NULL, 0, -1, NULL) < 0)
-1, NULL) < 0)
goto exit_monitor;
}

View File

@ -2630,24 +2630,17 @@ qemuMonitorCloseFileHandle(qemuMonitor *mon,
int
qemuMonitorAddNetdev(qemuMonitor *mon,
virJSONValue **props,
int *tapfd, char **tapfdName, int tapfdSize,
int slirpfd, char *slirpfdName)
{
int ret = -1;
size_t i = 0;
VIR_DEBUG("props=%p tapfd=%p tapfdName=%p tapfdSize=%d"
VIR_DEBUG("props=%p "
"slirpfd=%d slirpfdName=%s",
props, tapfd, tapfdName, tapfdSize,
props,
slirpfd, slirpfdName);
QEMU_CHECK_MONITOR(mon);
for (i = 0; i < tapfdSize; i++) {
if (qemuMonitorSendFileHandle(mon, tapfdName[i], tapfd[i]) < 0)
goto cleanup;
}
if (slirpfd > 0 &&
qemuMonitorSendFileHandle(mon, slirpfdName, slirpfd) < 0)
goto cleanup;
@ -2656,10 +2649,6 @@ qemuMonitorAddNetdev(qemuMonitor *mon,
cleanup:
if (ret < 0) {
while (i--) {
if (qemuMonitorCloseFileHandle(mon, tapfdName[i]) < 0)
VIR_WARN("failed to close device handle '%s'", tapfdName[i]);
}
if (qemuMonitorCloseFileHandle(mon, slirpfdName) < 0)
VIR_WARN("failed to close device handle '%s'", slirpfdName);
}

View File

@ -983,7 +983,6 @@ int qemuMonitorCloseFileHandle(qemuMonitor *mon,
int qemuMonitorAddNetdev(qemuMonitor *mon,
virJSONValue **props,
int *tapfd, char **tapfdName, int tapfdSize,
int slirpfd, char *slirpfdName);
int qemuMonitorRemoveNetdev(qemuMonitor *mon,