Re: [PATCH 3/3] qemu_passt: Remove passt socket file on exit

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

 



On 2/21/23 2:19 PM, Stefano Brivio wrote:
Just like it can't remove its own PID files, passt can't unlink its
own socket upon exit (unless the initialisation fails), because it
has no access to the filesystem at runtime.

Remove the socket file in qemuPasstKill().

Fixes: a56f0168d576 ("qemu: hook up passt config to qemu domains")
Signed-off-by: Stefano Brivio <sbrivio@xxxxxxxxxx>

Reviewed-by: Laine Stump <laine@xxxxxxxxxx>

(it's independent of the rest of the series, so I pushed it)
---
  src/qemu/qemu_passt.c | 9 ++++++---
  1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/qemu/qemu_passt.c b/src/qemu/qemu_passt.c
index c7012e349a..0e028ca752 100644
--- a/src/qemu/qemu_passt.c
+++ b/src/qemu/qemu_passt.c
@@ -103,7 +103,7 @@ qemuPasstAddNetProps(virDomainObj *vm,
static void
-qemuPasstKill(const char *pidfile)
+qemuPasstKill(const char *pidfile, const char *passtSocketName)
  {
      virErrorPtr orig_err;
      pid_t pid = 0;
@@ -115,6 +115,8 @@ qemuPasstKill(const char *pidfile)
          virProcessKillPainfully(pid, true);
      unlink(pidfile);
+ unlink(passtSocketName);
+
      virErrorRestore(&orig_err);
  }
@@ -124,8 +126,9 @@ qemuPasstStop(virDomainObj *vm,
                virDomainNetDef *net)
  {
      g_autofree char *pidfile = qemuPasstCreatePidFilename(vm, net);
+    g_autofree char *passtSocketName = qemuPasstCreateSocketPath(vm, net);
- qemuPasstKill(pidfile);
+    qemuPasstKill(pidfile, passtSocketName);
  }
@@ -284,6 +287,6 @@ qemuPasstStart(virDomainObj *vm,
      return 0;
error:
-    qemuPasstKill(pidfile);
+    qemuPasstKill(pidfile, passtSocketName);
      return -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