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

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