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 ...
|
624fa80c | 18-Mar-2021 |
Markus Armbruster <armbru@redhat.com> |
monitor: Drop query-qmp-schema 'gen': false hack
QMP commands return their response as a generated QAPI type, which the monitor core converts to JSON via QObject.
query-qmp-schema's response is the
monitor: Drop query-qmp-schema 'gen': false hack
QMP commands return their response as a generated QAPI type, which the monitor core converts to JSON via QObject.
query-qmp-schema's response is the generated introspection data. This is a QLitObject since commit 7d0f982bfb "qapi: generate a literal qobject for introspection", v2.12). Before, it was a string. Instead of converting QLitObject / string -> QObject -> QAPI type SchemaInfoList -> QObject -> JSON, we take a shortcut: the command is 'gen': false, so it can return the QObject instead of the QAPI type. Slightly simpler and more efficient.
The next commit will filter the response for output policy, and this is easier in the SchemaInfoList representation. Drop the shortcut.
This replaces the manual command registration by a generated one. The manual registration makes the command available before the machine is built by passing flag QCO_ALLOW_PRECONFIG. To keep it available there, we need need to add 'allow-preconfig': true to its definition in the schema.
Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20210318155519.1224118-7-armbru@redhat.com>
show more ...
|
f3750266 | 17-Feb-2021 |
Kevin Wolf <kwolf@redhat.com> |
qom: Factor out user_creatable_process_cmdline()
The implementation for --object can be shared between qemu-storage-daemon and other binaries, so move it into a function in qom/object_interfaces.c t
qom: Factor out user_creatable_process_cmdline()
The implementation for --object can be shared between qemu-storage-daemon and other binaries, so move it into a function in qom/object_interfaces.c that is accessible from everywhere.
This also requires moving the implementation of qmp_object_add() into a new user_creatable_add_qapi(), because qom/qom-qmp-cmds.c is not linked for tools.
user_creatable_print_help_from_qdict() can become static now.
Signed-off-by: Kevin Wolf <kwolf@redhat.com> Acked-by: Paolo Bonzini <pbonzini@redhat.com> Acked-by: Peter Krempa <pkrempa@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com>
show more ...
|