qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Marc-André Lureau" <marcandre.lureau@redhat.com>
To: Stefan Weil <sw@weilnetz.de>
Cc: qemu-devel <qemu-devel@nongnu.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	"P. Berrange, Daniel" <berrange@redhat.com>,
	qemu-block <qemu-block@nongnu.org>, Fam Zheng <famz@redhat.com>,
	Michael Roth <mdroth@linux.vnet.ibm.com>
Subject: Re: [Qemu-devel] [PATCH 3/3] RFC: delete PID file on exit
Date: Fri, 31 Aug 2018 18:35:45 +0200	[thread overview]
Message-ID: <CAMxuvawK3NP0ANN=JWUWXRN2F3Fq-Va2VegGxrLE7OVCA4+eZA@mail.gmail.com> (raw)
In-Reply-To: <721c3a96-60a3-0d74-80d6-586d5bb7a2e1@weilnetz.de>

Hi

On Fri, Aug 31, 2018 at 6:29 PM, Stefan Weil <sw@weilnetz.de> wrote:
> Am 31.08.2018 um 16:53 schrieb Marc-André Lureau:
> [...]
>> +static const char *pid_file;
>> +
>> +static void qemu_unlink_pidfile(void)
>> +{
>> +    if (pid_file) {
>> +        unlink(pid_file);
>> +    }
>> +}
>> +
>>  bool machine_init_done;
>>
>>  void qemu_add_machine_init_done_notifier(Notifier *notify)
>> @@ -2927,7 +2936,6 @@ int main(int argc, char **argv, char **envp)
>>      const char *vga_model = NULL;
>>      const char *qtest_chrdev = NULL;
>>      const char *qtest_log = NULL;
>> -    const char *pid_file = NULL;
>>      const char *incoming = NULL;
>>      bool userconfig = true;
>>      bool nographic = false;
>> @@ -4000,6 +4008,7 @@ int main(int argc, char **argv, char **envp)
>>          error_reportf_err(err, "cannot create PID file: ");
>>          exit(1);
>>      }
>> +    atexit(qemu_unlink_pidfile);
>
>
> Could qemu_unlink_pidfile be combined with qemu_run_exit_notifiers to
> avoid an additional call of atexit from the same function (main)?
>
> Even if there is support for 32 or more atexit calls, it might be good
> to be a little bit more restrictive.

Sure, that would require an additional Notifier, but that's not much anyway.
I'll update the patch.

  reply	other threads:[~2018-08-31 16:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-31 14:53 [Qemu-devel] [PATCH 0/3] util: add qemu_write_pidfile() Marc-André Lureau
2018-08-31 14:53 ` [Qemu-devel] [PATCH 1/3] " Marc-André Lureau
2018-09-03  9:55   ` Daniel P. Berrangé
2018-08-31 14:53 ` [Qemu-devel] [PATCH 2/3] util: use fcntl() for qemu_write_pidfile() locking Marc-André Lureau
2018-08-31 14:53 ` [Qemu-devel] [PATCH 3/3] RFC: delete PID file on exit Marc-André Lureau
2018-08-31 16:29   ` Stefan Weil
2018-08-31 16:35     ` Marc-André Lureau [this message]
2018-09-11 13:14 ` [Qemu-devel] [PATCH 0/3] util: add qemu_write_pidfile() Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMxuvawK3NP0ANN=JWUWXRN2F3Fq-Va2VegGxrLE7OVCA4+eZA@mail.gmail.com' \
    --to=marcandre.lureau@redhat.com \
    --cc=berrange@redhat.com \
    --cc=famz@redhat.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=sw@weilnetz.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).