On 07/24/2018 01:44 AM, Thomas Huth wrote:
Furthermore, we are NOT detecting EINTR (while EINTR shouldn't be
happening if we didn't install signal handlers, it's still better
to always be robust), and also want to log unexpected non-zero status
that was not accompanied by a core dump.
kill(s->qemu_pid, SIGTERM);
+ retry:
pid = waitpid(s->qemu_pid, &wstatus, 0);
+ if (pid == -1 && errno == EINTR) {
+ goto retry;
+ }
do {
pid = waitpid(s->qemu_pid, &wstatus, 0);
} while (pid == -1 && errno == EINTR);
?
Or use the TFR macro from include/qemu-common.h ?
Cool, I didn't know that macro existed! Will send v3.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org