On a Tuesday in 2026, Laine Stump via Devel wrote:
From: Laine Stump <[email protected]>

When using a vhost-user connection between passt and QEMU, passt will
autocreate a socket called ${socketname}.repair, but doesn't delete
this socket when it exits, so to be a good citizen, libvirtshould

Missing space.

delete it when we are tearing down the passt device plumbing.

Resolves: https://issues.redhat.com/browse/RHEL-80285
Signed-off-by: Laine Stump <[email protected]>
---
src/qemu/qemu_passt.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_passt.c b/src/qemu/qemu_passt.c
index 520eb1244a..56d048d585 100644
--- a/src/qemu/qemu_passt.c
+++ b/src/qemu/qemu_passt.c
@@ -121,7 +121,7 @@ qemuPasstAddNetProps(virDomainObj *vm,


static void
-qemuPasstKill(const char *pidfile, const char *passtSocketName)
+qemuPasstKill(const virDomainNetDef *net, const char *pidfile, const char 
*passtSocketName)
{
    virErrorPtr orig_err;
    pid_t pid = 0;
@@ -135,6 +135,14 @@ qemuPasstKill(const char *pidfile, const char 
*passtSocketName)

    unlink(passtSocketName);

+    /* repair socket is (always) created by passt only for vhostuser mode */
+    if (virDomainNetGetActualType(net) == VIR_DOMAIN_NET_TYPE_VHOSTUSER) {
+        g_autofree char *passtRepairSocketName
+            = g_strdup_printf("%s.repair", passtSocketName);

If you drop 'passt' from the variable name, it might fit on one line.

Jano

+
+        unlink(passtRepairSocketName);
+    }
+
    virErrorRestore(&orig_err);
}

@@ -146,7 +154,7 @@ qemuPasstStop(virDomainObj *vm,
    g_autofree char *pidfile = qemuPasstCreatePidFilename(vm, net);
    g_autofree char *passtSocketName = qemuPasstCreateSocketPath(vm, net);

-    qemuPasstKill(pidfile, passtSocketName);
+    qemuPasstKill(net, pidfile, passtSocketName);
}


@@ -351,6 +359,6 @@ qemuPasstStart(virDomainObj *vm,
    return 0;

 error:
-    qemuPasstKill(pidfile, passtSocketName);
+    qemuPasstKill(net, pidfile, passtSocketName);
    return -1;
}
--
2.52.0

Attachment: signature.asc
Description: PGP signature

Reply via email to