render / rpms / qemu

Forked from rpms/qemu 10 months ago
Clone

Blame 0095-virtiofsd-use-fuse_lowlevel_is_virtio-in-fuse_sessio.patch

1d442b
From: Stefan Hajnoczi <stefanha@redhat.com>
1d442b
Date: Mon, 27 Jan 2020 19:02:04 +0000
1d442b
Subject: [PATCH] virtiofsd: use fuse_lowlevel_is_virtio() in
1d442b
 fuse_session_destroy()
1d442b
MIME-Version: 1.0
1d442b
Content-Type: text/plain; charset=UTF-8
1d442b
Content-Transfer-Encoding: 8bit
1d442b
1d442b
vu_socket_path is NULL when --fd=FDNUM was used.  Use
1d442b
fuse_lowlevel_is_virtio() instead.
1d442b
1d442b
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
1d442b
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
1d442b
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
1d442b
(cherry picked from commit 620e9d8d9cee6df7fe71168dea950dba0cc21a4a)
1d442b
---
1d442b
 tools/virtiofsd/fuse_lowlevel.c | 7 ++++---
1d442b
 1 file changed, 4 insertions(+), 3 deletions(-)
1d442b
1d442b
diff --git a/tools/virtiofsd/fuse_lowlevel.c b/tools/virtiofsd/fuse_lowlevel.c
1d442b
index 70568d22a4..dab6a31e08 100644
1d442b
--- a/tools/virtiofsd/fuse_lowlevel.c
1d442b
+++ b/tools/virtiofsd/fuse_lowlevel.c
1d442b
@@ -2537,12 +2537,13 @@ void fuse_session_destroy(struct fuse_session *se)
1d442b
         close(se->fd);
1d442b
     }
1d442b
 
1d442b
-    if (se->vu_socket_path) {
1d442b
+    if (fuse_lowlevel_is_virtio(se)) {
1d442b
         virtio_session_close(se);
1d442b
-        free(se->vu_socket_path);
1d442b
-        se->vu_socket_path = NULL;
1d442b
     }
1d442b
 
1d442b
+    free(se->vu_socket_path);
1d442b
+    se->vu_socket_path = NULL;
1d442b
+
1d442b
     free(se);
1d442b
 }
1d442b