qemuMonitorAddNetdev: Remove unneeded 'slirp' variables and useless debug

None of the callers now uses the slirp fd passing feature, so it can be
removed.

At this point even the VIR_DEBUG doesn't make sense as it would only log
the pointer of 'props'.

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 16:50:58 +02:00
parent 08b0ac6683
commit 485a336f5d
3 changed files with 5 additions and 27 deletions

View File

@ -1401,8 +1401,7 @@ qemuDomainAttachNetDevice(virQEMUDriver *driver,
charDevPlugged = true; charDevPlugged = true;
} }
if (qemuMonitorAddNetdev(priv->mon, &netprops, if (qemuMonitorAddNetdev(priv->mon, &netprops) < 0) {
-1, NULL) < 0) {
qemuDomainObjExitMonitor(vm); qemuDomainObjExitMonitor(vm);
virDomainAuditNet(vm, NULL, net, "attach", false); virDomainAuditNet(vm, NULL, net, "attach", false);
goto try_remove; goto try_remove;
@ -2170,8 +2169,7 @@ qemuDomainAttachChrDevice(virQEMUDriver *driver,
chardevAttached = true; chardevAttached = true;
if (netdevprops) { if (netdevprops) {
if (qemuMonitorAddNetdev(priv->mon, &netdevprops, if (qemuMonitorAddNetdev(priv->mon, &netdevprops) < 0)
-1, NULL) < 0)
goto exit_monitor; goto exit_monitor;
} }

View File

@ -2629,31 +2629,12 @@ qemuMonitorCloseFileHandle(qemuMonitor *mon,
int int
qemuMonitorAddNetdev(qemuMonitor *mon, qemuMonitorAddNetdev(qemuMonitor *mon,
virJSONValue **props, virJSONValue **props)
int slirpfd, char *slirpfdName)
{ {
int ret = -1;
VIR_DEBUG("props=%p "
"slirpfd=%d slirpfdName=%s",
props,
slirpfd, slirpfdName);
QEMU_CHECK_MONITOR(mon); QEMU_CHECK_MONITOR(mon);
if (slirpfd > 0 && return qemuMonitorJSONAddNetdev(mon, props);
qemuMonitorSendFileHandle(mon, slirpfdName, slirpfd) < 0)
goto cleanup;
ret = qemuMonitorJSONAddNetdev(mon, props);
cleanup:
if (ret < 0) {
if (qemuMonitorCloseFileHandle(mon, slirpfdName) < 0)
VIR_WARN("failed to close device handle '%s'", slirpfdName);
}
return ret;
} }

View File

@ -982,8 +982,7 @@ int qemuMonitorCloseFileHandle(qemuMonitor *mon,
const char *fdname); const char *fdname);
int qemuMonitorAddNetdev(qemuMonitor *mon, int qemuMonitorAddNetdev(qemuMonitor *mon,
virJSONValue **props, virJSONValue **props);
int slirpfd, char *slirpfdName);
int qemuMonitorRemoveNetdev(qemuMonitor *mon, int qemuMonitorRemoveNetdev(qemuMonitor *mon,
const char *alias); const char *alias);