提交 652ce2d4 编写于 作者: P Paolo Bonzini 提交者: Anthony Liguori

loop write in qemu_event_increment upon EINTR

Same as what qemu-kvm does.
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
Signed-off-by: NAnthony Liguori <aliguori@us.ibm.com>
上级 1d0f0d91
......@@ -3217,8 +3217,12 @@ static void qemu_event_increment(void)
if (io_thread_fd == -1)
return;
ret = write(io_thread_fd, &byte, sizeof(byte));
if (ret < 0 && (errno != EINTR && errno != EAGAIN)) {
do {
ret = write(io_thread_fd, &byte, sizeof(byte));
} 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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册