virtiofsd: use fuse_lowlevel_is_virtio() in fuse_session_destroy()

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

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
This commit is contained in:
Stefan Hajnoczi 2019-06-26 17:51:32 +01:00 committed by Dr. David Alan Gilbert
parent 0e81414c54
commit 620e9d8d9c

View File

@ -2537,12 +2537,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);
}