[PATCH 22/37] qemuDomainAttachNetDevice: Remove 'vhostfd' machinery

Peter Krempa pkrempa at redhat.com
Tue May 10 15:19:58 UTC 2022


Now all the helper variables and code are not needed.

Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 src/qemu/qemu_hotplug.c | 16 ----------------
 1 file changed, 16 deletions(-)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index 2bede03e35..68e8030929 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1188,9 +1188,6 @@ qemuDomainAttachNetDevice(virQEMUDriver *driver,
     char **tapfdName = NULL;
     int *tapfd = NULL;
     size_t tapfdSize = 0;
-    char **vhostfdName = NULL;
-    int *vhostfd = NULL;
-    size_t vhostfdSize = 0;
     g_autoptr(virJSONValue) nicprops = NULL;
     g_autoptr(virJSONValue) netprops = NULL;
     int ret = -1;
@@ -1423,14 +1420,10 @@ qemuDomainAttachNetDevice(virQEMUDriver *driver,
     }

     tapfdName = g_new0(char *, tapfdSize);
-    vhostfdName = g_new0(char *, vhostfdSize);

     for (i = 0; i < tapfdSize; i++)
         tapfdName[i] = g_strdup_printf("fd-%s%zu", net->info.alias, i);

-    for (i = 0; i < vhostfdSize; i++)
-        vhostfdName[i] = g_strdup_printf("vhostfd-%s%zu", net->info.alias, i);
-
     if (!(netprops = qemuBuildHostNetProps(net,
                                            tapfdName, tapfdSize,
                                            NULL, 0,
@@ -1481,8 +1474,6 @@ qemuDomainAttachNetDevice(virQEMUDriver *driver,

     for (i = 0; i < tapfdSize; i++)
         VIR_FORCE_CLOSE(tapfd[i]);
-    for (i = 0; i < vhostfdSize; i++)
-        VIR_FORCE_CLOSE(vhostfd[i]);

     if (!(nicprops = qemuBuildNicDevProps(vm->def, net, priv->qemuCaps)))
         goto try_remove;
@@ -1584,13 +1575,6 @@ qemuDomainAttachNetDevice(virQEMUDriver *driver,
     }
     VIR_FREE(tapfd);
     VIR_FREE(tapfdName);
-    for (i = 0; vhostfd && i < vhostfdSize; i++) {
-        VIR_FORCE_CLOSE(vhostfd[i]);
-        if (vhostfdName)
-            VIR_FREE(vhostfdName[i]);
-    }
-    VIR_FREE(vhostfd);
-    VIR_FREE(vhostfdName);
     virDomainCCWAddressSetFree(ccwaddrs);
     VIR_FORCE_CLOSE(slirpfd);

-- 
2.35.1



More information about the libvir-list mailing list