|
From: | Eric Blake |
Subject: | Re: [Qemu-devel] [PATCH v2 for-3.0] tests/libqtest: Improve kill_qemu() |
Date: | Mon, 30 Jul 2018 16:26:16 -0500 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 |
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
[Prev in Thread] | Current Thread | [Next in Thread] |