thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone

Blame SOURCES/kvm-virtiofsd-use-fuse_lowlevel_is_virtio-in-fuse_sessio.patch

ddf19c
From 1724f54070d33d8070ba2d22c8fac87ea65814c1 Mon Sep 17 00:00:00 2001
ddf19c
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
ddf19c
Date: Mon, 27 Jan 2020 19:02:04 +0100
ddf19c
Subject: [PATCH 093/116] virtiofsd: use fuse_lowlevel_is_virtio() in
ddf19c
 fuse_session_destroy()
ddf19c
MIME-Version: 1.0
ddf19c
Content-Type: text/plain; charset=UTF-8
ddf19c
Content-Transfer-Encoding: 8bit
ddf19c
ddf19c
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
ddf19c
Message-id: <20200127190227.40942-90-dgilbert@redhat.com>
ddf19c
Patchwork-id: 93540
ddf19c
O-Subject: [RHEL-AV-8.2 qemu-kvm PATCH 089/112] virtiofsd: use fuse_lowlevel_is_virtio() in fuse_session_destroy()
ddf19c
Bugzilla: 1694164
ddf19c
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
ddf19c
RH-Acked-by: Stefan Hajnoczi <stefanha@redhat.com>
ddf19c
RH-Acked-by: Sergio Lopez Pascual <slp@redhat.com>
ddf19c
ddf19c
From: Stefan Hajnoczi <stefanha@redhat.com>
ddf19c
ddf19c
vu_socket_path is NULL when --fd=FDNUM was used.  Use
ddf19c
fuse_lowlevel_is_virtio() instead.
ddf19c
ddf19c
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
ddf19c
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
ddf19c
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
ddf19c
(cherry picked from commit 620e9d8d9cee6df7fe71168dea950dba0cc21a4a)
ddf19c
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
ddf19c
---
ddf19c
 tools/virtiofsd/fuse_lowlevel.c | 7 ++++---
ddf19c
 1 file changed, 4 insertions(+), 3 deletions(-)
ddf19c
ddf19c
diff --git a/tools/virtiofsd/fuse_lowlevel.c b/tools/virtiofsd/fuse_lowlevel.c
ddf19c
index 70568d2..dab6a31 100644
ddf19c
--- a/tools/virtiofsd/fuse_lowlevel.c
ddf19c
+++ b/tools/virtiofsd/fuse_lowlevel.c
ddf19c
@@ -2537,12 +2537,13 @@ void fuse_session_destroy(struct fuse_session *se)
ddf19c
         close(se->fd);
ddf19c
     }
ddf19c
 
ddf19c
-    if (se->vu_socket_path) {
ddf19c
+    if (fuse_lowlevel_is_virtio(se)) {
ddf19c
         virtio_session_close(se);
ddf19c
-        free(se->vu_socket_path);
ddf19c
-        se->vu_socket_path = NULL;
ddf19c
     }
ddf19c
 
ddf19c
+    free(se->vu_socket_path);
ddf19c
+    se->vu_socket_path = NULL;
ddf19c
+
ddf19c
     free(se);
ddf19c
 }
ddf19c
 
ddf19c
-- 
ddf19c
1.8.3.1
ddf19c