aboutsummaryrefslogtreecommitdiff
path: root/util/qemu-option.c
diff options
context:
space:
mode:
authorMasayoshi Mizuma <m.mizuma@jp.fujitsu.com>2019-08-13 16:06:45 -0400
committerDr. David Alan Gilbert <dgilbert@redhat.com>2020-01-23 16:41:37 +0000
commit96814800d2b49d18737c36e021c387697ec40c62 (patch)
tree67ed626200c562ca1439da75b2f386b780239626 /util/qemu-option.c
parent18a69cbbb6a4caa7c2040c6db4a33b044a32be7e (diff)
downloadqemu-96814800d2b49d18737c36e021c387697ec40c62.zip
qemu-96814800d2b49d18737c36e021c387697ec40c62.tar.gz
qemu-96814800d2b49d18737c36e021c387697ec40c62.tar.bz2
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>
Diffstat (limited to 'util/qemu-option.c')
0 files changed, 0 insertions, 0 deletions