git.annexia.org
/
libguestfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
If qemu dies during launch in "null vmchannel" mode, don't hang (RHBZ#579155).
[libguestfs.git]
/
src
/
guestfs.c
diff --git
a/src/guestfs.c
b/src/guestfs.c
index
d8c856a
..
fe08cb5
100644
(file)
--- a/
src/guestfs.c
+++ b/
src/guestfs.c
@@
-2366,8
+2366,16
@@
accept_from_daemon (guestfs_h *g)
int sock = -1;
while (sock == -1) {
int sock = -1;
while (sock == -1) {
+ /* If the qemu process has died, clean up the zombie (RHBZ#579155).
+ * By partially polling in the select below we ensure that this
+ * function will be called eventually.
+ */
+ waitpid (g->pid, NULL, WNOHANG);
+
rset2 = rset;
rset2 = rset;
- int r = select (max_fd+1, &rset2, NULL, NULL, NULL);
+
+ struct timeval tv = { .tv_sec = 1, .tv_usec = 0 };
+ int r = select (max_fd+1, &rset2, NULL, NULL, &tv);
if (r == -1) {
if (errno == EINTR || errno == EAGAIN)
continue;
if (r == -1) {
if (errno == EINTR || errno == EAGAIN)
continue;