9d8f8233 | 09-Jun-2022 |
Hanna Reitz <hreitz@redhat.com> |
qsd: Unlink absolute PID file path
After writing the PID file, we register an atexit() handler to unlink it when the process terminates. However, if the process has changed its working directory in
qsd: Unlink absolute PID file path
After writing the PID file, we register an atexit() handler to unlink it when the process terminates. However, if the process has changed its working directory in the meantime (e.g. in os_setup_post() when daemonizing), this will not work when the PID file path was relative. Therefore, pass the absolute path (created with realpath()) to the unlink() call in the atexit() handler.
(realpath() needs a path pointing to an existing file, so we cannot use it before qemu_write_pidfile().)
Reproducer: $ cd /tmp $ qemu-storage-daemon --daemonize --pidfile qsd.pid $ file qsd.pid qsd.pid: ASCII text $ kill $(cat qsd.pid) $ file qsd.pid qsd.pid: ASCII text
(qsd.pid should be gone after the process has terminated.)
Buglink: https://bugzilla.redhat.com/show_bug.cgi?id=2092322 Signed-off-by: Hanna Reitz <hreitz@redhat.com> Message-Id: <20220609122701.17172-2-hreitz@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
show more ...
|
779d82e1 | 14-Jun-2022 |
Xie Yongji <xieyongji@bytedance.com> |
vduse-blk: Add name option
Currently we use 'id' option as the name of VDUSE device. It's a bit confusing since we use one value for two different purposes: the ID to identfy the export within QEMU
vduse-blk: Add name option
Currently we use 'id' option as the name of VDUSE device. It's a bit confusing since we use one value for two different purposes: the ID to identfy the export within QEMU (must be distinct from any other exports in the same QEMU process, but can overlap with names used by other processes), and the VDUSE name to uniquely identify it on the host (must be distinct from other VDUSE devices on the same host, but can overlap with other export types like NBD in the same process). To make it clear, this patch adds a separate 'name' option to specify the VDUSE name for the vduse-blk export instead.
Signed-off-by: Xie Yongji <xieyongji@bytedance.com> Message-Id: <20220614051532.92-7-xieyongji@bytedance.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
2525edd8 | 03-Mar-2022 |
Hanna Reitz <hreitz@redhat.com> |
qsd: Add --daemonize
To implement this, we reuse the existing daemonizing functions from the system emulator, which mainly do the following: - Fork off a child process, and set up a pipe between par
qsd: Add --daemonize
To implement this, we reuse the existing daemonizing functions from the system emulator, which mainly do the following: - Fork off a child process, and set up a pipe between parent and child - The parent process waits until the child sends a status byte over the pipe (0 means that the child was set up successfully; anything else (including errors or EOF) means that the child was not set up successfully), and then exits with an appropriate exit status - The child process enters a new session (forking off again), changes the umask, and will ignore terminal signals from then on - Once set-up is complete, the child will chdir to /, redirect all standard I/O streams to /dev/null, and tell the parent that set-up has been completed successfully
In contrast to qemu-nbd's --fork implementation, during the set up phase, error messages are not piped through the parent process. qemu-nbd mainly does this to detect errors, though (while os_daemonize() has the child explicitly signal success after set up); because we do not redirect stderr after forking, error messages continue to appear on whatever the parent's stderr was (until set up is complete).
Signed-off-by: Hanna Reitz <hreitz@redhat.com> Message-Id: <20220303164814.284974-4-hreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|
cb90ec3a | 31-Jan-2022 |
Hanna Reitz <hreitz@redhat.com> |
qsd: Document fuse's allow-other option
We did not add documentation to the storage daemon's man page for fuse's allow-other option when it was introduced, so do that now.
Fixes: 8fc54f9428b9763f80
qsd: Document fuse's allow-other option
We did not add documentation to the storage daemon's man page for fuse's allow-other option when it was introduced, so do that now.
Fixes: 8fc54f9428b9763f800 ("export/fuse: Add allow-other option") Signed-off-by: Hanna Reitz <hreitz@redhat.com> Message-Id: <20220131103124.20325-1-hreitz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
show more ...
|