diff mbox series

[086/104] virtiofsd: use fuse_lowlevel_is_virtio() in fuse_session_destroy()

Message ID 20191212163904.159893-87-dgilbert@redhat.com
State New
Headers show
Series virtiofs daemon [all] | expand

Commit Message

Dr. David Alan Gilbert Dec. 12, 2019, 4:38 p.m. UTC
From: Stefan Hajnoczi <stefanha@redhat.com>

vu_socket_path is NULL when --fd=FDNUM was used.  Use
fuse_lowlevel_is_virtio() instead.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
  pull request 10
---
 tools/virtiofsd/fuse_lowlevel.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Daniel P. Berrangé Jan. 7, 2020, 12:01 p.m. UTC | #1
On Thu, Dec 12, 2019 at 04:38:46PM +0000, Dr. David Alan Gilbert (git) wrote:
> From: Stefan Hajnoczi <stefanha@redhat.com>
> 
> vu_socket_path is NULL when --fd=FDNUM was used.  Use
> fuse_lowlevel_is_virtio() instead.
> 
> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
>   pull request 10

Extraneous line

> ---
>  tools/virtiofsd/fuse_lowlevel.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>


Regards,
Daniel
Dr. David Alan Gilbert Jan. 7, 2020, 1:24 p.m. UTC | #2
* Daniel P. Berrangé (berrange@redhat.com) wrote:
> On Thu, Dec 12, 2019 at 04:38:46PM +0000, Dr. David Alan Gilbert (git) wrote:
> > From: Stefan Hajnoczi <stefanha@redhat.com>
> > 
> > vu_socket_path is NULL when --fd=FDNUM was used.  Use
> > fuse_lowlevel_is_virtio() instead.
> > 
> > Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
> >   pull request 10
> 
> Extraneous line

Hmm, not sure where that came from; thanks.

> > ---
> >  tools/virtiofsd/fuse_lowlevel.c | 7 ++++---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>

Thanks!

> 
> 
> Regards,
> Daniel
> -- 
> |: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
> |: https://libvirt.org         -o-            https://fstop138.berrange.com :|
> |: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK
diff mbox series

Patch

diff --git a/tools/virtiofsd/fuse_lowlevel.c b/tools/virtiofsd/fuse_lowlevel.c
index 4b5fe1d7a1..10f478b00c 100644
--- a/tools/virtiofsd/fuse_lowlevel.c
+++ b/tools/virtiofsd/fuse_lowlevel.c
@@ -2544,12 +2544,13 @@  void fuse_session_destroy(struct fuse_session *se)
         close(se->fd);
     }
 
-    if (se->vu_socket_path) {
+    if (fuse_lowlevel_is_virtio(se)) {
         virtio_session_close(se);
-        free(se->vu_socket_path);
-        se->vu_socket_path = NULL;
     }
 
+    free(se->vu_socket_path);
+    se->vu_socket_path = NULL;
+
     free(se);
 }