loop write in qemu_event_increment upon EINTR
Same as what qemu-kvm does. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
parent
1d0f0d91f2
commit
652ce2d449
6
vl.c
6
vl.c
@ -3217,8 +3217,12 @@ static void qemu_event_increment(void)
|
||||
if (io_thread_fd == -1)
|
||||
return;
|
||||
|
||||
do {
|
||||
ret = write(io_thread_fd, &byte, sizeof(byte));
|
||||
if (ret < 0 && (errno != EINTR && errno != EAGAIN)) {
|
||||
} while (ret < 0 && errno == EINTR);
|
||||
|
||||
/* EAGAIN is fine, a read must be pending. */
|
||||
if (ret < 0 && errno != EAGAIN) {
|
||||
fprintf(stderr, "qemu_event_increment: write() filed: %s\n",
|
||||
strerror(errno));
|
||||
exit (1);
|
||||
|
Loading…
Reference in New Issue
Block a user