]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemuMonitorAddNetdev: Remove unneeded 'slirp' variables and useless debug
authorPeter Krempa <pkrempa@redhat.com>
Tue, 10 May 2022 14:50:58 +0000 (16:50 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 16 May 2022 07:15:46 +0000 (09:15 +0200)
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>
src/qemu/qemu_hotplug.c
src/qemu/qemu_monitor.c
src/qemu/qemu_monitor.h

index 0f3b1f4bc4997f8d5e0552e56a6ca5a13ea8ee0f..cae7b0dd3b500f49aae12a7298a25f8470355530 100644 (file)
@@ -1401,8 +1401,7 @@ qemuDomainAttachNetDevice(virQEMUDriver *driver,
         charDevPlugged = true;
     }
 
-    if (qemuMonitorAddNetdev(priv->mon, &netprops,
-                             -1, NULL) < 0) {
+    if (qemuMonitorAddNetdev(priv->mon, &netprops) < 0) {
         qemuDomainObjExitMonitor(vm);
         virDomainAuditNet(vm, NULL, net, "attach", false);
         goto try_remove;
@@ -2170,8 +2169,7 @@ qemuDomainAttachChrDevice(virQEMUDriver *driver,
     chardevAttached = true;
 
     if (netdevprops) {
-        if (qemuMonitorAddNetdev(priv->mon, &netdevprops,
-                                -1, NULL) < 0)
+        if (qemuMonitorAddNetdev(priv->mon, &netdevprops) < 0)
             goto exit_monitor;
     }
 
index a71311d0c4ece02901165ad0fb6da700211899b0..d44c7f0c604dc6ece4b67130760548f94361c586 100644 (file)
@@ -2629,31 +2629,12 @@ qemuMonitorCloseFileHandle(qemuMonitor *mon,
 
 int
 qemuMonitorAddNetdev(qemuMonitor *mon,
-                     virJSONValue **props,
-                     int slirpfd, char *slirpfdName)
+                     virJSONValue **props)
 {
-    int ret = -1;
-
-    VIR_DEBUG("props=%p "
-              "slirpfd=%d slirpfdName=%s",
-              props,
-              slirpfd, slirpfdName);
 
     QEMU_CHECK_MONITOR(mon);
 
-    if (slirpfd > 0 &&
-        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;
+    return qemuMonitorJSONAddNetdev(mon, props);
 }
 
 
index a49ef180c1399ab940048cfc83edae82811594af..b1484fdff829c171af217146c281eb161e68ecb1 100644 (file)
@@ -982,8 +982,7 @@ int qemuMonitorCloseFileHandle(qemuMonitor *mon,
                                const char *fdname);
 
 int qemuMonitorAddNetdev(qemuMonitor *mon,
-                         virJSONValue **props,
-                         int slirpfd, char *slirpfdName);
+                         virJSONValue **props);
 
 int qemuMonitorRemoveNetdev(qemuMonitor *mon,
                             const char *alias);