diff options
author | Paolo Bonzini <pbonzini@redhat.com> | 2021-06-15 08:34:52 +0200 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-06-25 10:54:13 +0200 |
commit | bd80936a4f18075e0e407df180801a9743ce290c (patch) | |
tree | e95f933bef92578b036057d5ad14efeef46545e2 | |
parent | 09e20abddaf94ff27dcced1df81f69a713627a94 (diff) | |
download | qemu-bd80936a4f18075e0e407df180801a9743ce290c.zip qemu-bd80936a4f18075e0e407df180801a9743ce290c.tar.gz qemu-bd80936a4f18075e0e407df180801a9743ce290c.tar.bz2 |
file-posix: handle EINTR during ioctl
Similar to other handle_aiocb_* functions, handle_aiocb_ioctl needs to cater
for the possibility that ioctl is interrupted by a signal. Otherwise, the
I/O is incorrectly reported as a failure to the guest.
Reported-by: Gordon Watson <gwatson@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r-- | block/file-posix.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/block/file-posix.c b/block/file-posix.c index 74b8216..a26eab0 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -1347,7 +1347,9 @@ static int handle_aiocb_ioctl(void *opaque) RawPosixAIOData *aiocb = opaque; int ret; - ret = ioctl(aiocb->aio_fildes, aiocb->ioctl.cmd, aiocb->ioctl.buf); + do { + ret = ioctl(aiocb->aio_fildes, aiocb->ioctl.cmd, aiocb->ioctl.buf); + } while (ret == -1 && errno == EINTR); if (ret == -1) { return -errno; } |