qemu-patch-raspberry4/tools/virtiofsd
Masayoshi Mizuma 96814800d2 virtiofsd: Prevent multiply running with same vhost_user_socket
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.mizuma@jp.fujitsu.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
  Applied fixes from Stefan's review and moved osdep include
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>
2020-01-23 16:41:37 +00:00
..
50-qemu-virtiofsd.json.in virtiofsd: add vhost-user.json file 2020-01-23 16:41:36 +00:00
buffer.c virtiofsd: add fuse_mbuf_iter API 2020-01-23 16:41:36 +00:00
fuse.h virtiofsd: Format imported files to qemu style 2020-01-23 16:41:36 +00:00
fuse_common.h virtiofsd: Parse flag FUSE_WRITE_KILL_PRIV 2020-01-23 16:41:37 +00:00
fuse_i.h virtiofsd: Plumb fuse_bufvec through to do_write_buf 2020-01-23 16:41:36 +00:00
fuse_log.c virtiofsd: Fix common header and define for QEMU builds 2020-01-23 16:41:36 +00:00
fuse_log.h virtiofsd: Format imported files to qemu style 2020-01-23 16:41:36 +00:00
fuse_lowlevel.c virtiofsd: Prevent multiply running with same vhost_user_socket 2020-01-23 16:41:37 +00:00
fuse_lowlevel.h virtiofsd: print log only when priority is high enough 2020-01-23 16:41:37 +00:00
fuse_misc.h virtiofsd: support nanosecond resolution for file timestamp 2020-01-23 16:41:37 +00:00
fuse_opt.c virtiofsd: Fix common header and define for QEMU builds 2020-01-23 16:41:36 +00:00
fuse_opt.h virtiofsd: Format imported files to qemu style 2020-01-23 16:41:36 +00:00
fuse_signals.c virtiofsd: Fix common header and define for QEMU builds 2020-01-23 16:41:36 +00:00
fuse_virtio.c virtiofsd: Prevent multiply running with same vhost_user_socket 2020-01-23 16:41:37 +00:00
fuse_virtio.h virtiofsd: cleanup allocated resource in se 2020-01-23 16:41:37 +00:00
helper.c virtiofsd: passthrough_ll: clean up cache related options 2020-01-23 16:41:37 +00:00
Makefile.objs virtiofsd: add seccomp whitelist 2020-01-23 16:41:37 +00:00
passthrough_helpers.h virtiofsd: Format imported files to qemu style 2020-01-23 16:41:36 +00:00
passthrough_ll.c virtiofsd: add helper for lo_data cleanup 2020-01-23 16:41:37 +00:00
seccomp.c virtiofsd: add --syslog command-line option 2020-01-23 16:41:37 +00:00
seccomp.h virtiofsd: add --syslog command-line option 2020-01-23 16:41:37 +00:00