]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemuMonitorAddNetdev: Remove 'vhostfd' machinery
authorPeter Krempa <pkrempa@redhat.com>
Tue, 10 May 2022 12:41:12 +0000 (14:41 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Mon, 16 May 2022 07:15:46 +0000 (09:15 +0200)
All callers now pass NULL/0 as arguments for vhostfd passing so we can
remove all the associated code.

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 17fe072e02dd1d86a4d203998b593c171e9f0a43..f7d3b38a6ab78882d2243835e4d0a04375350cba 100644 (file)
@@ -1461,7 +1461,6 @@ qemuDomainAttachNetDevice(virQEMUDriver *driver,
 
     if (qemuMonitorAddNetdev(priv->mon, &netprops,
                              tapfd, tapfdName, tapfdSize,
-                             NULL, NULL, 0,
                              slirpfd, slirpfdName) < 0) {
         qemuDomainObjExitMonitor(vm);
         virDomainAuditNet(vm, NULL, net, "attach", false);
@@ -2242,7 +2241,7 @@ qemuDomainAttachChrDevice(virQEMUDriver *driver,
 
     if (netdevprops) {
         if (qemuMonitorAddNetdev(priv->mon, &netdevprops,
-                                 NULL, NULL, 0, NULL, NULL, 0, -1, NULL) < 0)
+                                 NULL, NULL, 0, -1, NULL) < 0)
             goto exit_monitor;
     }
 
index 39004201c0c3a2457a94148afaf7a8969450ae22..57a9e9af62f4a2f6947b483549d274a2c805997d 100644 (file)
@@ -2631,17 +2631,15 @@ int
 qemuMonitorAddNetdev(qemuMonitor *mon,
                      virJSONValue **props,
                      int *tapfd, char **tapfdName, int tapfdSize,
-                     int *vhostfd, char **vhostfdName, int vhostfdSize,
                      int slirpfd, char *slirpfdName)
 {
     int ret = -1;
-    size_t i = 0, j = 0;
+    size_t i = 0;
 
     VIR_DEBUG("props=%p tapfd=%p tapfdName=%p tapfdSize=%d"
-              "vhostfd=%p vhostfdName=%p vhostfdSize=%d"
               "slirpfd=%d slirpfdName=%s",
               props, tapfd, tapfdName, tapfdSize,
-              vhostfd, vhostfdName, vhostfdSize, slirpfd, slirpfdName);
+              slirpfd, slirpfdName);
 
     QEMU_CHECK_MONITOR(mon);
 
@@ -2649,10 +2647,6 @@ qemuMonitorAddNetdev(qemuMonitor *mon,
         if (qemuMonitorSendFileHandle(mon, tapfdName[i], tapfd[i]) < 0)
             goto cleanup;
     }
-    for (j = 0; j < vhostfdSize; j++) {
-        if (qemuMonitorSendFileHandle(mon, vhostfdName[j], vhostfd[j]) < 0)
-            goto cleanup;
-    }
 
     if (slirpfd > 0 &&
         qemuMonitorSendFileHandle(mon, slirpfdName, slirpfd) < 0)
@@ -2666,10 +2660,6 @@ qemuMonitorAddNetdev(qemuMonitor *mon,
             if (qemuMonitorCloseFileHandle(mon, tapfdName[i]) < 0)
                 VIR_WARN("failed to close device handle '%s'", tapfdName[i]);
         }
-        while (j--) {
-            if (qemuMonitorCloseFileHandle(mon, vhostfdName[j]) < 0)
-                VIR_WARN("failed to close device handle '%s'", vhostfdName[j]);
-        }
         if (qemuMonitorCloseFileHandle(mon, slirpfdName) < 0)
             VIR_WARN("failed to close device handle '%s'", slirpfdName);
     }
index 79d8486d080031c917b9da467e42593c40f05cf6..1008b336715503650f700bba5c1c2f4b1ad141e7 100644 (file)
@@ -984,7 +984,6 @@ int qemuMonitorCloseFileHandle(qemuMonitor *mon,
 int qemuMonitorAddNetdev(qemuMonitor *mon,
                          virJSONValue **props,
                          int *tapfd, char **tapfdName, int tapfdSize,
-                         int *vhostfd, char **vhostfdName, int vhostfdSize,
                          int slirpfd, char *slirpfdName);
 
 int qemuMonitorRemoveNetdev(qemuMonitor *mon,