From: Christoph Hellwig <hch@lst.de>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 1/2] fix asynchronous ioctls
Date: Tue, 28 Apr 2009 11:57:02 +0200 [thread overview]
Message-ID: <20090428095702.GA4710@lst.de> (raw)
posix_aio_read expect aio requests to return the number of bytes
requests to be successfull, so we need to fake this up for ioctls.
[NB: this function is formatted using tabs, so the new code is too.
Or should I convert the whole function in my patch?]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: qemu/posix-aio-compat.c
===================================================================
--- qemu.orig/posix-aio-compat.c 2009-04-28 11:42:33.801074561 +0200
+++ qemu/posix-aio-compat.c 2009-04-28 11:44:18.392076590 +0200
@@ -90,7 +90,16 @@ static size_t handle_aiocb_ioctl(struct
ret = ioctl(aiocb->aio_fildes, aiocb->aio_ioctl_cmd, aiocb->aio_ioctl_buf);
if (ret == -1)
return -errno;
- return ret;
+
+ /*
+ * This looks weird, but the aio code only consideres a request
+ * successfull if it has written the number full number of bytes.
+ *
+ * Now we overload aio_nbytes as aio_ioctl_cmd for the ioctl command,
+ * so in fact we return the ioctl command here to make posix_aio_read()
+ * happy..
+ */
+ return aiocb->aio_nbytes;
}
#ifdef HAVE_PREADV
next reply other threads:[~2009-04-28 9:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-28 9:57 Christoph Hellwig [this message]
2009-05-01 13:55 ` [Qemu-devel] [PATCH 1/2] fix asynchronous ioctls Anthony Liguori
2009-05-01 14:20 ` Christoph Hellwig
2009-05-04 15:06 ` Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090428095702.GA4710@lst.de \
--to=hch@lst.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.