[PATCH 17/37] qemuDomainAttachNetDevice: Don't construct network device properties under monitor lock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



After the 'qemuFDPass' code was refactored we no longer need to hand off
the FD to qemu before we know the path for it.

Thus the call to qemuBuildHostNetProps can be moved outside of the
monitor critical section.

Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx>
---
 src/qemu/qemu_hotplug.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/qemu/qemu_hotplug.c b/src/qemu/qemu_hotplug.c
index d5bdeb83ae..525c55baf2 100644
--- a/src/qemu/qemu_hotplug.c
+++ b/src/qemu/qemu_hotplug.c
@@ -1452,17 +1452,15 @@ qemuDomainAttachNetDevice(virQEMUDriver *driver,
     for (i = 0; i < vhostfdSize; i++)
         vhostfdName[i] = g_strdup_printf("vhostfd-%s%zu", net->info.alias, i);

-    qemuDomainObjEnterMonitor(driver, vm);
-
-    if (qemuFDPassTransferMonitor(netpriv->vdpafd, priv->mon) < 0) {
-        qemuDomainObjExitMonitor(vm);
-        goto cleanup;
-    }
-
     if (!(netprops = qemuBuildHostNetProps(net,
                                            tapfdName, tapfdSize,
                                            vhostfdName, vhostfdSize,
-                                           slirpfdName))) {
+                                           slirpfdName)))
+        goto cleanup;
+
+    qemuDomainObjEnterMonitor(driver, vm);
+
+    if (qemuFDPassTransferMonitor(netpriv->vdpafd, priv->mon) < 0) {
         qemuDomainObjExitMonitor(vm);
         goto cleanup;
     }
-- 
2.35.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux