22.12.2021 14:41, Hanna Reitz wrote:
This option does basically the same as --fork does for qemu-nbd:
Can we share the code? Before this patch we already have --fork code-path of qemu-nbd and -daemonize code-path of QEMU.. Now we have one more. Did you consider improving and sharing the old code instead?
- We fork off a child process - The child process is daemonized (closing its stdin and stdout) - stderr of the child is routed through the parent, so the parent can see errors and adjust its exit code accordingly - Once the child closes its end of this stderr pipe (done right after creating the PID file), the parent exits It is not named --fork, because --fork was probably a name that few programs but qemu-nbd ever used. qemu (the system emulator) itself uses -daemonize, too. (Besides, QSD's interface is not compatible to qemu-nbd anyway; compare --pidfile vs. --pid-file.) Signed-off-by: Hanna Reitz<hre...@redhat.com>
-- Best regards, Vladimir