On Thu, Dec 12, 2019 at 04:38:41PM +0000, Dr. David Alan Gilbert (git) wrote: > From: Masayoshi Mizuma <m.miz...@jp.fujitsu.com> > > virtiofsd can run multiply even if the vhost_user_socket is same path. > > ]# ./virtiofsd -o vhost_user_socket=/tmp/vhostqemu -o source=/tmp/share & > [1] 244965 > virtio_session_mount: Waiting for vhost-user socket connection... > ]# ./virtiofsd -o vhost_user_socket=/tmp/vhostqemu -o source=/tmp/share & > [2] 244966 > virtio_session_mount: Waiting for vhost-user socket connection... > ]# > > The user will get confused about the situation and maybe the cause of the > unexpected problem. So it's better to prevent the multiple running. > > Create a regular file under localstatedir directory to exclude the > vhost_user_socket. To create and lock the file, use qemu_write_pidfile() > because the API has some sanity checks and file lock. > > Signed-off-by: Masayoshi Mizuma <m.miz...@jp.fujitsu.com> > Signed-off-by: Dr. David Alan Gilbert <dgilb...@redhat.com> > Applied fixes from Stefan's review and moved osdep include > Signed-off-by: Stefan Hajnoczi <stefa...@redhat.com> > --- > tools/virtiofsd/fuse_lowlevel.c | 1 + > tools/virtiofsd/fuse_virtio.c | 49 ++++++++++++++++++++++++++++++++- > 2 files changed, 49 insertions(+), 1 deletion(-)
Reviewed-by: Daniel P. Berrangé <berra...@redhat.com> 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 :|