qemu-block
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 2/3] qsd: Add --daemonize


From: Vladimir Sementsov-Ogievskiy
Subject: Re: [PATCH 2/3] qsd: Add --daemonize
Date: Thu, 30 Dec 2021 19:12:17 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0

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<hreitz@redhat.com>


--
Best regards,
Vladimir



reply via email to

[Prev in Thread] Current Thread [Next in Thread]