mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
qemu: delete passt "repair" socket when appropriate
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, libvirt should
delete it when we are tearing down the passt device plumbing.
Resolves: https://issues.redhat.com/browse/RHEL-80285
Signed-off-by: Laine Stump <laine@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
1 parent
3ea1550c64
commit
0ae2dde5a8
1 file changed
+11
-3
+11
-3
@@ -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 = NULL;
|
||||
|
||||
passtRepairSocketName = g_strdup_printf("%s.repair", passtSocketName);
|
||||
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;
|
||||
}
|
||||
Reference in new issue
Block a user