[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 05/29] vl: split various early command line options to a sepa
|
From: |
Paolo Bonzini |
|
Subject: |
Re: [PATCH 05/29] vl: split various early command line options to a separate function |
|
Date: |
Mon, 2 Nov 2020 17:33:23 +0100 |
|
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 |
On 02/11/20 16:30, Igor Mammedov wrote:
> On Tue, 27 Oct 2020 14:21:20 -0400
> Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>> Various options affect the global state of QEMU including the rest of
>> qemu_init, and they need to be called very early. Group them together
>> in a function that is called at the beginning.
>>
>> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
>> ---
>> softmmu/vl.c | 202 ++++++++++++++++++++++++++++-----------------------
>> 1 file changed, 113 insertions(+), 89 deletions(-)
>>
>> diff --git a/softmmu/vl.c b/softmmu/vl.c
> [...]
>> +
>> +static void qemu_maybe_daemonize(const char *pid_file)
>
> why it's _maybe_ ?
> It looks to me as just deamonize (or die which could be omitted)
Because os_daemonize() in turn only daemonize if the corresponding
option was set:
void os_daemonize(void)
{
if (daemonize) {
pid_t pid;
int fds[2];
...
Paolo
>> +{
>> + Error *err;
>> +
>> + os_daemonize();
>> + rcu_disable_atfork();
>> +
>> + if (pid_file && !qemu_write_pidfile(pid_file, &err)) {
>> + error_reportf_err(err, "cannot create PID file: ");
>> + exit(1);
>> + }
>> +
>> + qemu_unlink_pidfile_notifier.notify = qemu_unlink_pidfile;
>> + qemu_add_exit_notifier(&qemu_unlink_pidfile_notifier);
>> +}
> [...]
>