qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/2] fix asynchronous ioctls
@ 2009-04-28  9:57 Christoph Hellwig
  2009-05-01 13:55 ` Anthony Liguori
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2009-04-28  9:57 UTC (permalink / raw)
  To: qemu-devel

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] fix asynchronous ioctls
  2009-04-28  9:57 [Qemu-devel] [PATCH 1/2] fix asynchronous ioctls Christoph Hellwig
@ 2009-05-01 13:55 ` Anthony Liguori
  2009-05-01 14:20   ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Anthony Liguori @ 2009-05-01 13:55 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: qemu-devel

Christoph Hellwig wrote:
> 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>
>   

Is there a 2/2?

Regards,

Anthony Liguori

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] fix asynchronous ioctls
  2009-05-01 13:55 ` Anthony Liguori
@ 2009-05-01 14:20   ` Christoph Hellwig
  2009-05-04 15:06     ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2009-05-01 14:20 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: Christoph Hellwig, qemu-devel

On Fri, May 01, 2009 at 08:55:41AM -0500, Anthony Liguori wrote:
> Christoph Hellwig wrote:
> >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>
> >  
> 
> Is there a 2/2?

2/2 is the SG_IO passthrough which I accidentally sent as reply to the
previous version.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH 1/2] fix asynchronous ioctls
  2009-05-01 14:20   ` Christoph Hellwig
@ 2009-05-04 15:06     ` Christoph Hellwig
  0 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2009-05-04 15:06 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: Christoph Hellwig, qemu-devel

On Fri, May 01, 2009 at 04:20:04PM +0200, Christoph Hellwig wrote:
> 2/2 is the SG_IO passthrough which I accidentally sent as reply to the
> previous version.

Any reason you pulled in the SG_IO passthrough but not this patch?

It's not going to work without it :)


Also the commits list seems to be a lagging a little bit, can't find
messages for at least the two patches you applied from me.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-05-04 15:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-28  9:57 [Qemu-devel] [PATCH 1/2] fix asynchronous ioctls Christoph Hellwig
2009-05-01 13:55 ` Anthony Liguori
2009-05-01 14:20   ` Christoph Hellwig
2009-05-04 15:06     ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).