Re: [Qemu-devel] [PATCH] block: remove redundant check before g_slist_find()

2015-06-29 Thread Alexander Yarygin
Alberto Garcia writes: > An empty GSList is represented by a NULL pointer, therefore it's a > perfectly valid argument for g_slist_find() and there's no need to > make any additional check. > > Signed-off-by: Alberto Garcia > --- > block/io.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion

Re: [Qemu-devel] [PATCH v3 2/2] virtio-blk: Use blk_drain() to drain IO requests

2015-06-26 Thread Alexander Yarygin
Markus Armbruster writes: > Just spotted this in my git-pull... > > Alexander Yarygin writes: > >> Each call of the virtio_blk_reset() function calls blk_drain_all(), >> which works for all existing BlockDriverStates, while draining only >> one is needed. >>

[Qemu-devel] [PATCH v3 0/2] Fix slow startup with many disks

2015-06-17 Thread Alexander Yarygin
on one disk at time. Since bdrv_drain_all() is still called in other places, patch 3 optimizes it for cases, where there are more disks than iothreads. Thanks. Alexander Yarygin (2): block-backend: Introduce blk_drain() virtio-blk: Use blk_drain() to drain IO requests block/block-backend.c

[Qemu-devel] [PATCH v3 2/2] virtio-blk: Use blk_drain() to drain IO requests

2015-06-17 Thread Alexander Yarygin
restores vblk->complete_request. Cc: "Michael S. Tsirkin" Cc: Christian Borntraeger Cc: Cornelia Huck Cc: Kevin Wolf Cc: Paolo Bonzini Cc: Stefan Hajnoczi Signed-off-by: Alexander Yarygin --- hw/block/virtio-blk.c | 15 ++- 1 file changed, 10 insertions(+), 5 delet

[Qemu-devel] [PATCH v3 1/2] block-backend: Introduce blk_drain()

2015-06-17 Thread Alexander Yarygin
This patch introduces the blk_drain() function which allows to replace blk_drain_all() when only one BlockDriverState needs to be drained. Cc: Christian Borntraeger Cc: Cornelia Huck Cc: Kevin Wolf Cc: Paolo Bonzini Cc: Stefan Hajnoczi Signed-off-by: Alexander Yarygin Reviewed-by: Paolo

Re: [Qemu-devel] [PATCH 3/3] block: Let bdrv_drain_all() to call aio_poll() for each AioContext

2015-06-16 Thread Alexander Yarygin
Stefan Hajnoczi writes: > On Wed, Jun 10, 2015 at 02:38:17PM +0300, Alexander Yarygin wrote: >> After the commit 9b536adc ("block: acquire AioContext in >> bdrv_drain_all()") the aio_poll() function got called for every >> BlockDriverState, in assumption tha

[Qemu-devel] [PATCH 3/3] block: Let bdrv_drain_all() to call aio_poll() for each AioContext

2015-06-10 Thread Alexander Yarygin
Signed-off-by: Alexander Yarygin --- block/io.c | 42 ++ 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/block/io.c b/block/io.c index e394d92..7502186 100644 --- a/block/io.c +++ b/block/io.c @@ -271,17 +271,6 @@ static bool bdrv_reques

[Qemu-devel] [PATCH 1/3] block-backend: Introduce blk_drain()

2015-06-10 Thread Alexander Yarygin
This patch introduces the blk_drain() function which allows to replace blk_drain_all() when only one BlockDriverState needs to be drained. Cc: Christian Borntraeger Cc: Cornelia Huck Cc: Kevin Wolf Cc: Paolo Bonzini Cc: Stefan Hajnoczi Signed-off-by: Alexander Yarygin Reviewed-by: Paolo

[Qemu-devel] [PATCH 2/3] virtio-blk: Use blk_drain() to drain IO requests

2015-06-10 Thread Alexander Yarygin
Bonzini Cc: Stefan Hajnoczi Signed-off-by: Alexander Yarygin --- hw/block/virtio-blk.c | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/hw/block/virtio-blk.c b/hw/block/virtio-blk.c index e6afe97..2009092 100644 --- a/hw/block/virtio-blk.c +++ b/hw/block/virtio

[Qemu-devel] [PATCH RFC v2 0/3] Fix slow startup with many disks

2015-06-10 Thread Alexander Yarygin
me. Since bdrv_drain_all() is still called in other places, patch 3 optimizes it for cases, where there are more disks than iothreads. Thanks. Alexander Yarygin (3): block-backend: Introduce blk_drain() virtio-blk: Use blk_drain() to drain IO requests block: Let bdrv_drain_all() to call aio_poll(

[Qemu-devel] [PATCH 2/2] block: Let bdrv_drain_all() to call aio_poll() for each AioContext

2015-06-03 Thread Alexander Yarygin
Signed-off-by: Alexander Yarygin --- block/io.c | 42 ++ 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/block/io.c b/block/io.c index e394d92..7502186 100644 --- a/block/io.c +++ b/block/io.c @@ -271,17 +271,6 @@ static bool bdrv_reques

[Qemu-devel] [PATCH 1/2] block-backend: Introduce blk_drain() and replace blk_drain_all()

2015-06-03 Thread Alexander Yarygin
Borntraeger Cc: Cornelia Huck Cc: Kevin Wolf Cc: Paolo Bonzini Cc: Stefan Hajnoczi Signed-off-by: Alexander Yarygin --- block/block-backend.c | 5 + hw/block/virtio-blk.c | 2 +- include/sysemu/block-backend.h | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a

[Qemu-devel] [PATCH RFC 0/2] Fix slow startup with many disks

2015-06-03 Thread Alexander Yarygin
loop by using bdrv_drain() instead of bdrv_drain_all(). bdrv_drain() works on one disk at time. Since bdrv_drain_all() is still called in other places, patch 2/2 optimizes it for cases, where there are more disks than iothreads. Thanks. Alexander Yarygin (2): block-backend: Introduce blk_drain

[Qemu-devel] [PATCH v2] block: Let bdrv_drain_all() to call aio_poll() for each AioContext

2015-05-14 Thread Alexander Yarygin
elia Huck Cc: Kevin Wolf Cc: Paolo Bonzini Cc: Stefan Hajnoczi Signed-off-by: Alexander Yarygin --- block.c | 40 +--- 1 file changed, 25 insertions(+), 15 deletions(-) diff --git a/block.c b/block.c index f2f8ae7..bdfb1ce 100644 --- a/block.c +++ b/block.c

Re: [Qemu-devel] [PATCH] block: Let bdrv_drain_all() to call aio_poll() for each AioContext

2015-05-14 Thread Alexander Yarygin
Paolo Bonzini writes: > On 13/05/2015 18:34, Alexander Yarygin wrote: >> Ah, right. We need second loop, something like this: >> >> @@ -2030,20 +2033,33 @@ void bdrv_drain(BlockDriverState *bs) >> void bdrv_drain_all(void) >> { >> /* Always run fi

Re: [Qemu-devel] [PATCH] block: Let bdrv_drain_all() to call aio_poll() for each AioContext

2015-05-14 Thread Alexander Yarygin
Fam Zheng writes: > On Wed, 05/13 19:34, Alexander Yarygin wrote: >> Paolo Bonzini writes: >> >> > On 13/05/2015 17:18, Alexander Yarygin wrote: >> >> After the commit 9b536adc ("block: acquire AioContext in >> >> bdrv_drain

Re: [Qemu-devel] [PATCH] block: Let bdrv_drain_all() to call aio_poll() for each AioContext

2015-05-13 Thread Alexander Yarygin
Paolo Bonzini writes: > On 13/05/2015 17:18, Alexander Yarygin wrote: >> After the commit 9b536adc ("block: acquire AioContext in >> bdrv_drain_all()") the aio_poll() function got called for every >> BlockDriverState, in assumption that every device may

Re: [Qemu-devel] [Qemu-block] [PATCH] block: Let bdrv_drain_all() to call aio_poll() for each AioContext

2015-05-13 Thread Alexander Yarygin
Alberto Garcia writes: > On Wed 13 May 2015 05:18:31 PM CEST, Alexander Yarygin > wrote: > >> +if (!aio_ctxs || !g_list_find(aio_ctxs, aio_context)) { >> +busy |= aio_poll(aio_context, busy); >> +aio_ctxs = g_list_a

[Qemu-devel] [PATCH] block: Let bdrv_drain_all() to call aio_poll() for each AioContext

2015-05-13 Thread Alexander Yarygin
elia Huck Cc: Kevin Wolf Cc: Paolo Bonzini Cc: Stefan Hajnoczi Signed-off-by: Alexander Yarygin --- block.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/block.c b/block.c index f2f8ae7..7414815 100644 --- a/block.c +++ b/block.c @@ -1994,7 +1994,6 @@ static