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: Hanna Reitz
Subject: Re: [PATCH 2/3] qsd: Add --daemonize
Date: Mon, 3 Jan 2022 18:15:44 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0

On 30.12.21 17:12, Vladimir Sementsov-Ogievskiy wrote:
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?

I didn’t really, to be honest.  I disliked sharing code with qemu-nbd, because, well, that would mean touching qemu-nbd (which I’d rather avoid).  Then again, I suppose we could theoretically just drop the daemonizing code from qemu-nbd, and replace it by calls to daemonize() and daemon_detach().  The only problem with that would be that we need some file into which to put it, that is linked into both qemu-nbd and the QSD.

QEMU proper already has os_daemonize() and os_setup_post(), but they’re quite different from what qemu-nbd does, for example, it doesn’t call qemu_daemon(), and it chdir()s to / (which we probably don’t want?).

I preferred to go with what qemu-nbd does, because I thought if it works for qemu-nbd, it should work for QSD, too.  Maybe I’m wrong, though, maybe we should just use os_daemonize() and os_setup_post().

Hanna




reply via email to

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