Re: [Qemu-devel] [PATCH 1/2] iscsi: add support for bdrv_co_is_allocated()

2013-06-24 Thread Stefan Hajnoczi
On Fri, Jun 21, 2013 at 11:18:42AM +0200, Kevin Wolf wrote: Am 20.06.2013 um 20:20 hat Peter Lieven geschrieben: @@ -800,6 +801,60 @@ iscsi_getlength(BlockDriverState *bs) return len; } +static int coroutine_fn iscsi_co_is_allocated(BlockDriverState *bs, +

Re: [Qemu-devel] [PATCH 1/2] iscsi: add support for bdrv_co_is_allocated()

2013-06-24 Thread Paolo Bonzini
Il 24/06/2013 10:13, Stefan Hajnoczi ha scritto: On Fri, Jun 21, 2013 at 11:18:42AM +0200, Kevin Wolf wrote: Am 20.06.2013 um 20:20 hat Peter Lieven geschrieben: @@ -800,6 +801,60 @@ iscsi_getlength(BlockDriverState *bs) return len; } +static int coroutine_fn

Re: [Qemu-devel] [PATCH 1/2] iscsi: add support for bdrv_co_is_allocated()

2013-06-24 Thread Peter Lieven
Am 24.06.2013 15:49, schrieb Paolo Bonzini: Il 24/06/2013 10:13, Stefan Hajnoczi ha scritto: On Fri, Jun 21, 2013 at 11:18:42AM +0200, Kevin Wolf wrote: Am 20.06.2013 um 20:20 hat Peter Lieven geschrieben: @@ -800,6 +801,60 @@ iscsi_getlength(BlockDriverState *bs) return len; }

Re: [Qemu-devel] [PATCH 1/2] iscsi: add support for bdrv_co_is_allocated()

2013-06-21 Thread Kevin Wolf
Am 20.06.2013 um 20:20 hat Peter Lieven geschrieben: Signed-off-by: Peter Lieven p...@kamp.de --- block/iscsi.c | 57 + 1 file changed, 57 insertions(+) diff --git a/block/iscsi.c b/block/iscsi.c index 0bbf0b1..e6b966d 100644

Re: [Qemu-devel] [PATCH 1/2] iscsi: add support for bdrv_co_is_allocated()

2013-06-21 Thread Peter Lieven
Am 21.06.2013 11:18, schrieb Kevin Wolf: Am 20.06.2013 um 20:20 hat Peter Lieven geschrieben: Signed-off-by: Peter Lieven p...@kamp.de --- block/iscsi.c | 57 + 1 file changed, 57 insertions(+) diff --git a/block/iscsi.c

Re: [Qemu-devel] [PATCH 1/2] iscsi: add support for bdrv_co_is_allocated()

2013-06-21 Thread Kevin Wolf
Am 21.06.2013 um 11:45 hat Peter Lieven geschrieben: Am 21.06.2013 11:18, schrieb Kevin Wolf: Am 20.06.2013 um 20:20 hat Peter Lieven geschrieben: Signed-off-by: Peter Lieven p...@kamp.de --- block/iscsi.c | 57 + 1 file

Re: [Qemu-devel] [PATCH 1/2] iscsi: add support for bdrv_co_is_allocated()

2013-06-21 Thread Peter Lieven
Am 21.06.2013 13:07, schrieb Kevin Wolf: Am 21.06.2013 um 11:45 hat Peter Lieven geschrieben: Am 21.06.2013 11:18, schrieb Kevin Wolf: Am 20.06.2013 um 20:20 hat Peter Lieven geschrieben: Signed-off-by: Peter Lieven p...@kamp.de --- block/iscsi.c | 57

Re: [Qemu-devel] [PATCH 1/2] iscsi: add support for bdrv_co_is_allocated()

2013-06-21 Thread Kevin Wolf
Am 21.06.2013 um 13:42 hat Peter Lieven geschrieben: Am 21.06.2013 13:07, schrieb Kevin Wolf: Am 21.06.2013 um 11:45 hat Peter Lieven geschrieben: Am 21.06.2013 11:18, schrieb Kevin Wolf: Am 20.06.2013 um 20:20 hat Peter Lieven geschrieben: Signed-off-by: Peter Lieven p...@kamp.de ---

Re: [Qemu-devel] [PATCH 1/2] iscsi: add support for bdrv_co_is_allocated()

2013-06-21 Thread Peter Lieven
Am 21.06.2013 15:14, schrieb Kevin Wolf: Am 21.06.2013 um 13:42 hat Peter Lieven geschrieben: Am 21.06.2013 13:07, schrieb Kevin Wolf: Am 21.06.2013 um 11:45 hat Peter Lieven geschrieben: Am 21.06.2013 11:18, schrieb Kevin Wolf: Am 20.06.2013 um 20:20 hat Peter Lieven geschrieben:

Re: [Qemu-devel] [PATCH 1/2] iscsi: add support for bdrv_co_is_allocated()

2013-06-21 Thread ronnie sahlberg
Should we really mix co-routines and AIO in the same backend? Would it not be better to instead add a new bdrb_aio_is_allocaed and use non-blocking async calls to libiscsi ? On Fri, Jun 21, 2013 at 2:18 AM, Kevin Wolf kw...@redhat.com wrote: Am 20.06.2013 um 20:20 hat Peter Lieven geschrieben:

Re: [Qemu-devel] [PATCH 1/2] iscsi: add support for bdrv_co_is_allocated()

2013-06-21 Thread Paolo Bonzini
Il 21/06/2013 13:07, Kevin Wolf ha scritto: Note that you're blocking here. The preferred way would be something involving a yield from the coroutine and a reenter as soon as all requests are done. Maybe a CoRwLock does what you need? Is there a document how to use it? Or can you help

Re: [Qemu-devel] [PATCH 1/2] iscsi: add support for bdrv_co_is_allocated()

2013-06-21 Thread Peter Lieven
Am 21.06.2013 18:31, schrieb Paolo Bonzini: Il 21/06/2013 13:07, Kevin Wolf ha scritto: Note that you're blocking here. The preferred way would be something involving a yield from the coroutine and a reenter as soon as all requests are done. Maybe a CoRwLock does what you need? Is there a

Re: [Qemu-devel] [PATCH 1/2] iscsi: add support for bdrv_co_is_allocated()

2013-06-21 Thread ronnie sahlberg
On Fri, Jun 21, 2013 at 10:06 AM, Peter Lieven p...@kamp.de wrote: Am 21.06.2013 18:31, schrieb Paolo Bonzini: Il 21/06/2013 13:07, Kevin Wolf ha scritto: Note that you're blocking here. The preferred way would be something involving a yield from the coroutine and a reenter as soon as all

Re: [Qemu-devel] [PATCH 1/2] iscsi: add support for bdrv_co_is_allocated()

2013-06-21 Thread Peter Lieven
Am 21.06.2013 19:13, schrieb ronnie sahlberg: On Fri, Jun 21, 2013 at 10:06 AM, Peter Lieven p...@kamp.de wrote: Am 21.06.2013 18:31, schrieb Paolo Bonzini: Il 21/06/2013 13:07, Kevin Wolf ha scritto: Note that you're blocking here. The preferred way would be something involving a yield from

Re: [Qemu-devel] [PATCH 1/2] iscsi: add support for bdrv_co_is_allocated()

2013-06-21 Thread Paolo Bonzini
Il 21/06/2013 18:06, ronnie sahlberg ha scritto: Should we really mix co-routines and AIO in the same backend? Would it not be better to instead add a new bdrb_aio_is_allocaed and use non-blocking async calls to libiscsi ? Certainly, but is_allocated's code is not the tidiest. I'm going to

[Qemu-devel] [PATCH 1/2] iscsi: add support for bdrv_co_is_allocated()

2013-06-20 Thread Peter Lieven
Signed-off-by: Peter Lieven p...@kamp.de --- block/iscsi.c | 57 + 1 file changed, 57 insertions(+) diff --git a/block/iscsi.c b/block/iscsi.c index 0bbf0b1..e6b966d 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -49,6 +49,7 @@ typedef

[Qemu-devel] [PATCH 1/2] iscsi: add support for bdrv_co_is_allocated()

2013-06-20 Thread Peter Lieven
Signed-off-by: Peter Lieven p...@kamp.de --- block/iscsi.c | 57 + 1 file changed, 57 insertions(+) diff --git a/block/iscsi.c b/block/iscsi.c index 0bbf0b1..e6b966d 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -49,6 +49,7 @@ typedef