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. Regards Stefan