[Qemu-devel] [PATCH] MAINTAINERS: update sheepdog maintainer

2014-09-03 Thread MORITA Kazutaka
Hitoshi takes over sheepdog maintenance from me. Signed-off-by: MORITA Kazutaka morita.kazut...@gmail.com --- MAINTAINERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MAINTAINERS b/MAINTAINERS index 59940f9..28a697d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -968,7

Re: [Qemu-devel] [sheepdog] [PATCH v4 2/2] sheepdog: support user-defined redundancy option

2013-11-01 Thread MORITA Kazutaka
At Thu, 31 Oct 2013 13:49:28 +0800, Liu Yuan wrote: +/* + * Sheepdog support two kinds of redundancy, full replication and erasure + * coding. + * + * # create a fully replicated vdi with x copies + * -o redundancy=x (1 = x = SD_MAX_COPIES) + * + * # create a erasure coded vdi with x

Re: [Qemu-devel] [sheepdog] [PATCH v5 RESENT 0/2] sheepdog: add user-defined redundancy option

2013-11-01 Thread MORITA Kazutaka
/sheepdog.c | 127 + include/block/block_int.h |1 + 2 files changed, 105 insertions(+), 23 deletions(-) Reviewed-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp

Re: [Qemu-devel] [sheepdog] [PATCH v2 2/2] sheepdog: support user-defined redundancy option

2013-10-30 Thread MORITA Kazutaka
At Tue, 29 Oct 2013 16:25:52 +0800, Liu Yuan wrote: Sheepdog support two kinds of redundancy, full replication and erasure coding. # create a fully replicated vdi with x copies -o redundancy=x (1 = x = SD_MAX_COPIES) # create a erasure coded vdi with x data strips and y parity strips

Re: [Qemu-devel] [sheepdog] [PATCH v2 0/2] sheepdog: make use of copy_policy

2013-10-25 Thread MORITA Kazutaka
as type uint8_t sheepdog: pass copy_policy in the request block/sheepdog.c | 30 +++--- 1 file changed, 19 insertions(+), 11 deletions(-) Acked-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp

[Qemu-devel] [PATCH v5 6/8] sheepdog: make add_aio_request and send_aioreq void functions

2013-10-24 Thread MORITA Kazutaka
These functions no longer return errors. We can make them void functions and simplify the codes. Reviewed-by: Liu Yuan namei.u...@gmail.com Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 66 ++ 1 file

[Qemu-devel] [PATCH v5 4/8] coroutine: add co_aio_sleep_ns() to allow sleep in block drivers

2013-10-24 Thread MORITA Kazutaka
This helper function behaves similarly to co_sleep_ns(), but the sleeping coroutine will be resumed when using qemu_aio_wait(). Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- include/block/coroutine.h |9 + qemu-coroutine-sleep.c| 14 ++ 2 files

[Qemu-devel] [PATCH v5 5/8] sheepdog: try to reconnect to sheepdog after network error

2013-10-24 Thread MORITA Kazutaka
This introduces a failed request queue and links all the inflight requests to the list after network error happens. After QEMU reconnects to the sheepdog server successfully, the sheepdog block driver will retry all the requests in the failed queue. Signed-off-by: MORITA Kazutaka morita.kazut

[Qemu-devel] [PATCH v5 1/8] sheepdog: check return values of qemu_co_recv/send correctly

2013-10-24 Thread MORITA Kazutaka
If qemu_co_recv/send doesn't return the specified length, it means that an error happened. Reviewed-by: Liu Yuan namei.u...@gmail.com Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff

[Qemu-devel] [PATCH v5 3/8] sheepdog: reload inode outside of resend_aioreq

2013-10-24 Thread MORITA Kazutaka
This prepares for using resend_aioreq() after reconnecting to the sheepdog server. Reviewed-by: Liu Yuan namei.u...@gmail.com Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 33 +++-- 1 file changed, 19 insertions(+), 14 deletions

[Qemu-devel] [PATCH v5 0/8] sheepdog: reconnect server after connection failure

2013-10-24 Thread MORITA Kazutaka
connection is lost. - Check simultaneous create in resend_aioreq(). v2: - Dropped nonblocking connect patches. MORITA Kazutaka (8): sheepdog: check return values of qemu_co_recv/send correctly sheepdog: handle vdi objects in resend_aio_req sheepdog: reload inode outside of resend_aioreq

[Qemu-devel] [PATCH v5 7/8] sheepdog: cancel aio requests if possible

2013-10-24 Thread MORITA Kazutaka
This patch tries to cancel aio requests in pending queue and failed queue. When the sheepdog driver cannot cancel the requests, it waits for them to be completed. Reviewed-by: Liu Yuan namei.u...@gmail.com Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 70

[Qemu-devel] [PATCH v5 8/8] sheepdog: check simultaneous create in resend_aioreq

2013-10-24 Thread MORITA Kazutaka
() and checks simultaneous create requests more strictly in resend_aioreq(). Reviewed-by: Liu Yuan namei.u...@gmail.com Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 64 +++--- 1 file changed, 32 insertions(+), 32

[Qemu-devel] [PATCH v5 2/8] sheepdog: handle vdi objects in resend_aio_req

2013-10-24 Thread MORITA Kazutaka
The current resend_aio_req() doesn't work when the request is against vdi objects. This fixes the problem. Reviewed-by: Liu Yuan namei.u...@gmail.com Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 21 - 1 file changed, 16 insertions

Re: [Qemu-devel] [PATCH] MAINTAINERS: add block driver sub-maintainers

2013-10-23 Thread MORITA Kazutaka
...@redhat.com +S: Supported +F: block/vmdk.c + +RBD +M: Josh Durgin josh.dur...@dreamhost.com +S: Supported +F: block/rbd.c + +Sheepdog +M: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp +S: Supported +F: block/sheepdog.c Acked-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp

Re: [Qemu-devel] [PATCH] MAINTAINERS: add block driver sub-maintainers

2013-10-23 Thread MORITA Kazutaka
At Wed, 23 Oct 2013 15:19:47 +0900, MORITA Kazutaka wrote: + +Sheepdog +M: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp +S: Supported +F: block/sheepdog.c Acked-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp Is it okay to add Liu Yuan tailai...@taobao.com to the sheepdog

Re: [Qemu-devel] [sheepdog] [PATCH 1/2] sheepdog: explicitly set copies as type uint8_t

2013-10-23 Thread MORITA Kazutaka
At Wed, 16 Oct 2013 15:38:37 +0800, Liu Yuan wrote: 'copies' is actually uint8_t since day one, but request headers and some helper functions parameterize it as uint32_t for unknown reasons and effectively reserve 24 bytes for possible future use. This patch explicitly set the correct

Re: [Qemu-devel] [sheepdog] [PATCH] sheepdog: implement .bdrv_get_allocated_file_size

2013-08-07 Thread MORITA Kazutaka
At Wed, 7 Aug 2013 16:59:53 +0800, Liu Yuan wrote: With this patch, qemu-img info sheepdog:image will show disk size for sheepdog images. Cc: Kevin Wolf kw...@redhat.com Cc: Stefan Hajnoczi stefa...@redhat.com Cc: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp Signed-off-by: Liu Yuan

Re: [Qemu-devel] [sheepdog] [PATCH] sheepdog: add missing .bdrv_has_zero_init

2013-08-06 Thread MORITA Kazutaka
At Tue, 6 Aug 2013 14:44:37 +0800, Liu Yuan wrote: Cc: Kevin Wolf kw...@redhat.com Cc: Stefan Hajnoczi stefa...@redhat.com Signed-off-by: Liu Yuan namei.u...@gmail.com --- block/sheepdog.c |2 ++ 1 file changed, 2 insertions(+) Reviewed-by: MORITA Kazutaka morita.kazut

Re: [Qemu-devel] [sheepdog] [PATCH v4 03/10] sheepdog: check return values of qemu_co_recv/send correctly

2013-08-02 Thread MORITA Kazutaka
At Tue, 30 Jul 2013 15:48:02 +0200, Stefan Hajnoczi wrote: On Fri, Jul 26, 2013 at 03:10:45PM +0900, MORITA Kazutaka wrote: If qemu_co_recv/send doesn't return the specified length, it means that an error happened. Tested-and-reviewed-by: Liu Yuan namei.u...@gmail.com Signed-off

Re: [Qemu-devel] [sheepdog] [PATCH v4 06/10] coroutine: add co_aio_sleep_ns() to allow sleep in block drivers

2013-08-02 Thread MORITA Kazutaka
At Tue, 30 Jul 2013 15:58:58 +0200, Stefan Hajnoczi wrote: On Fri, Jul 26, 2013 at 03:10:48PM +0900, MORITA Kazutaka wrote: This helper function behaves similarly to co_sleep_ns(), but the sleeping coroutine will be resumed when using qemu_aio_wait(). Signed-off-by: MORITA Kazutaka

Re: [Qemu-devel] [PATCH 1/4] block/sheepdog: Rename 'dprintf' to 'DPRINTF'

2013-07-29 Thread MORITA Kazutaka
.) Signed-off-by: Peter Maydell peter.mayd...@linaro.org Acked-by: Kevin Wolf kw...@redhat.com (CCed Kazutaka in case he has any objections, unexpectedly) No problem. Reviewed-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp Thanks, Kazutaka

[Qemu-devel] [PATCH v4 01/10] ignore SIGPIPE in qemu-img and qemu-io

2013-07-26 Thread MORITA Kazutaka
This prevents the tools from being stopped when they write data to a closed connection in the other side. Reviewed-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- qemu-img.c | 4 qemu-io.c | 4 2 files changed, 8 insertions

[Qemu-devel] [PATCH v4 06/10] coroutine: add co_aio_sleep_ns() to allow sleep in block drivers

2013-07-26 Thread MORITA Kazutaka
This helper function behaves similarly to co_sleep_ns(), but the sleeping coroutine will be resumed when using qemu_aio_wait(). Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- include/block/coroutine.h | 8 qemu-coroutine-sleep.c| 47

[Qemu-devel] [PATCH v4 02/10] iov: handle EOF in iov_send_recv

2013-07-26 Thread MORITA Kazutaka
Without this patch, iov_send_recv() never returns when do_send_recv() returns zero. Reviewed-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- util/iov.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/util/iov.c b/util/iov.c index

[Qemu-devel] [PATCH v4 05/10] sheepdog: reload inode outside of resend_aioreq

2013-07-26 Thread MORITA Kazutaka
This prepares for using resend_aioreq() after reconnecting to the sheepdog server. Tested-and-reviewed-by: Liu Yuan namei.u...@gmail.com Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 33 +++-- 1 file changed, 19 insertions(+), 14

[Qemu-devel] [PATCH v4 10/10] sheepdog: check simultaneous create in resend_aioreq

2013-07-26 Thread MORITA Kazutaka
() and checks simultaneous create requests more strictly in resend_aioreq(). Tested-and-reviewed-by: Liu Yuan namei.u...@gmail.com Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 64 1 file changed, 32 insertions

[Qemu-devel] [PATCH v4 09/10] sheepdog: cancel aio requests if possible

2013-07-26 Thread MORITA Kazutaka
This patch tries to cancel aio requests in pending queue and failed queue. When the sheepdog driver cannot cancel the requests, it waits for them to be completed. Tested-and-reviewed-by: Liu Yuan namei.u...@gmail.com Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block

[Qemu-devel] [PATCH v4 08/10] sheepdog: make add_aio_request and send_aioreq void functions

2013-07-26 Thread MORITA Kazutaka
These functions no longer return errors. We can make them void functions and simplify the codes. Tested-and-reviewed-by: Liu Yuan namei.u...@gmail.com Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 66

[Qemu-devel] [PATCH v4 03/10] sheepdog: check return values of qemu_co_recv/send correctly

2013-07-26 Thread MORITA Kazutaka
If qemu_co_recv/send doesn't return the specified length, it means that an error happened. Tested-and-reviewed-by: Liu Yuan namei.u...@gmail.com Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 16 1 file changed, 8 insertions(+), 8 deletions

[Qemu-devel] [PATCH v4 04/10] sheepdog: handle vdi objects in resend_aio_req

2013-07-26 Thread MORITA Kazutaka
The current resend_aio_req() doesn't work when the request is against vdi objects. This fixes the problem. Tested-and-reviewed-by: Liu Yuan namei.u...@gmail.com Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 21 - 1 file changed, 16

[Qemu-devel] [PATCH v4 00/10] sheepdog: reconnect server after connection failure

2013-07-26 Thread MORITA Kazutaka
in resend_aioreq(). v2: - Dropped nonblocking connect patches. MORITA Kazutaka (10): ignore SIGPIPE in qemu-img and qemu-io iov: handle EOF in iov_send_recv sheepdog: check return values of qemu_co_recv/send correctly sheepdog: handle vdi objects in resend_aio_req sheepdog: reload inode

[Qemu-devel] [PATCH v4 07/10] sheepdog: try to reconnect to sheepdog after network error

2013-07-26 Thread MORITA Kazutaka
...@gmail.com Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 78 +--- 1 file changed, 63 insertions(+), 15 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index 7b22816..3860611 100644 --- a/block

[Qemu-devel] [PATCH v3 02/10] iov: handle EOF in iov_send_recv

2013-07-25 Thread MORITA Kazutaka
Without this patch, iov_send_recv() never returns when do_send_recv() returns zero. Reviewed-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- util/iov.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/util/iov.c b/util/iov.c index

[Qemu-devel] [PATCH v3 10/10] sheepdog: check simultaneous create in resend_aioreq

2013-07-25 Thread MORITA Kazutaka
() and checks simultaneous create requests more strictly in resend_aioreq(). Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 64 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/block/sheepdog.c b/block

[Qemu-devel] [PATCH v3 01/10] ignore SIGPIPE in qemu-img and qemu-io

2013-07-25 Thread MORITA Kazutaka
This prevents the tools from being stopped when they write data to a closed connection in the other side. Reviewed-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- qemu-img.c | 4 qemu-io.c | 4 2 files changed, 8 insertions

[Qemu-devel] [PATCH v3 06/10] coroutine: add co_aio_sleep_ns() to allow sleep in block drivers

2013-07-25 Thread MORITA Kazutaka
This helper function behaves similarly to co_sleep_ns(), but the sleeping coroutine will be resumed when using qemu_aio_wait(). Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- include/block/coroutine.h | 8 qemu-coroutine-sleep.c| 47

[Qemu-devel] [PATCH v3 08/10] sheepdog: make add_aio_request and send_aioreq void functions

2013-07-25 Thread MORITA Kazutaka
These functions no longer return errors. We can make them void functions and simplify the codes. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 66 +++- 1 file changed, 17 insertions(+), 49 deletions

[Qemu-devel] [PATCH v3 04/10] sheepdog: handle vdi objects in resend_aio_req

2013-07-25 Thread MORITA Kazutaka
The current resend_aio_req() doesn't work when the request is against vdi objects. This fixes the problem. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/block

[Qemu-devel] [PATCH v3 00/10] sheepdog: reconnect server after connection failure

2013-07-25 Thread MORITA Kazutaka
/send more strictly. - Move inflight requests to the failed list after reconnection completes. This is necessary to resend I/Os while connection is lost. - Check simultaneous create in resend_aioreq(). v2: - Dropped nonblocking connect patches. MORITA Kazutaka (10): ignore SIGPIPE

[Qemu-devel] [PATCH v3 03/10] sheepdog: check return values of qemu_co_recv/send correctly

2013-07-25 Thread MORITA Kazutaka
If qemu_co_recv/send doesn't return the specified length, it means that an error happened. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c

[Qemu-devel] [PATCH v3 05/10] sheepdog: reload inode outside of resend_aioreq

2013-07-25 Thread MORITA Kazutaka
This prepares for using resend_aioreq() after reconnecting to the sheepdog server. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 33 +++-- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/block/sheepdog.c b/block

[Qemu-devel] [PATCH v3 07/10] sheepdog: try to reconnect to sheepdog after network error

2013-07-25 Thread MORITA Kazutaka
This introduces a failed request queue and links all the inflight requests to the list after network error happens. After QEMU reconnects to the sheepdog server successfully, the sheepdog block driver will retry all the requests in the failed queue. Signed-off-by: MORITA Kazutaka morita.kazut

[Qemu-devel] [PATCH v3 09/10] sheepdog: cancel aio requests if possible

2013-07-25 Thread MORITA Kazutaka
This patch tries to cancel aio requests in pending queue and failed queue. When the sheepdog driver cannot cancel the requests, it waits for them to be completed. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 70

Re: [Qemu-devel] [sheepdog] [PATCH v3 03/10] sheepdog: check return values of qemu_co_recv/send correctly

2013-07-25 Thread MORITA Kazutaka
At Thu, 25 Jul 2013 16:46:36 +0800, Liu Yuan wrote: On Thu, Jul 25, 2013 at 05:31:58PM +0900, MORITA Kazutaka wrote: If qemu_co_recv/send doesn't return the specified length, it means that an error happened. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block

Re: [Qemu-devel] [sheepdog] [PATCH v3 07/10] sheepdog: try to reconnect to sheepdog after network error

2013-07-25 Thread MORITA Kazutaka
At Thu, 25 Jul 2013 17:13:46 +0800, Liu Yuan wrote: + +/* Try to reconnect the sheepdog server every one second. */ +while (s-fd 0) { +s-fd = get_sheep_fd(s); +if (s-fd 0) { +dprintf(Wait for connection to be established\n); +

Re: [Qemu-devel] [sheepdog] [PATCH v3 09/10] sheepdog: cancel aio requests if possible

2013-07-25 Thread MORITA Kazutaka
At Thu, 25 Jul 2013 17:04:53 +0800, Liu Yuan wrote: +/* + * Check whether the specified acb can be canceled + * + * We can cancel aio when any request belonging to the acb is: + * - Not processed by the sheepdog server. + * - Not linked to the inflight queue. + */ +static

Re: [Qemu-devel] [PATCH v6 13/18] block/sheepdog: drop have_co_req() and aio_flush_request()

2013-07-25 Thread MORITA Kazutaka
(-) Reviewed-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp

Re: [Qemu-devel] [sheepdog] [PATCH v3 07/10] sheepdog: try to reconnect to sheepdog after network error

2013-07-25 Thread MORITA Kazutaka
At Thu, 25 Jul 2013 21:20:43 +0800, Liu Yuan wrote: On Thu, Jul 25, 2013 at 09:53:14PM +0900, MORITA Kazutaka wrote: At Thu, 25 Jul 2013 17:13:46 +0800, Liu Yuan wrote: + +/* Try to reconnect the sheepdog server every one second. */ +while (s-fd 0) { +s

Re: [Qemu-devel] [sheepdog] [PATCH 00/11] sheepdog: reconnect server after connection failure

2013-07-24 Thread MORITA Kazutaka
At Tue, 23 Jul 2013 13:08:04 +0200, Luca Lazzeroni wrote: Is this series of patches applyable to sheepdog-stable-0.6 band qemu 1.5.0 ? I've seen they use async i/o... This series is against upstream qemu. I've not tried it with qemu 1.5.x, but probably it can be applied without a big

Re: [Qemu-devel] [sheepdog] [PATCH 03/11] qemu-sockets: make wait_for_connect be invoked in qemu_aio_wait

2013-07-24 Thread MORITA Kazutaka
At Tue, 23 Jul 2013 13:36:08 +0200, Paolo Bonzini wrote: Il 23/07/2013 10:30, MORITA Kazutaka ha scritto: This allows us to use inet_nonblocking_connect() and unix_nonblocking_connect() in block drivers. qemu-ga needs to link block-obj to resolve dependencies

[Qemu-devel] [PATCH v2 0/9] sheepdog: reconnect server after connection failure

2013-07-24 Thread MORITA Kazutaka
MORITA Kazutaka (9): ignore SIGPIPE in qemu-img and qemu-io iov: handle EOF in iov_send_recv sheepdog: check return values of qemu_co_recv/send correctly sheepdog: handle vdi objects in resend_aio_req sheepdog: reload inode outside of resend_aioreq coroutine: add co_aio_sleep_ns

[Qemu-devel] [PATCH v2 6/9] coroutine: add co_aio_sleep_ns() to allow sleep in block drivers

2013-07-24 Thread MORITA Kazutaka
This helper function behaves similarly to co_sleep_ns(), but the sleeping coroutine will be resumed when using qemu_aio_wait(). Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- include/block/coroutine.h | 8 qemu-coroutine-sleep.c| 47

[Qemu-devel] [PATCH v2 4/9] sheepdog: handle vdi objects in resend_aio_req

2013-07-24 Thread MORITA Kazutaka
The current resend_aio_req() doesn't work when the request is against vdi objects. This fixes the problem. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/block

[Qemu-devel] [PATCH v2 3/9] sheepdog: check return values of qemu_co_recv/send correctly

2013-07-24 Thread MORITA Kazutaka
qemu_co_recv/send return shorter length on error. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index 6a41ad9..bca5730 100644 --- a/block/sheepdog.c

[Qemu-devel] [PATCH v2 1/9] ignore SIGPIPE in qemu-img and qemu-io

2013-07-24 Thread MORITA Kazutaka
This prevents the tools from being stopped when they write data to a closed connection in the other side. Reviewed-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- qemu-img.c | 4 qemu-io.c | 4 2 files changed, 8 insertions

[Qemu-devel] [PATCH v2 9/9] sheepdog: cancel aio requests if possible

2013-07-24 Thread MORITA Kazutaka
This patch tries to cancel aio requests in pending queue and failed queue. When the sheepdog driver cannot cancel the requests, it waits for them to be completed. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 70

[Qemu-devel] [PATCH v2 7/9] sheepdog: try to reconnect to sheepdog after network error

2013-07-24 Thread MORITA Kazutaka
This introduces a failed request queue and links all the inflight requests to the list after network error happens. After QEMU reconnects to the sheepdog server successfully, the sheepdog block driver will retry all the requests in the failed queue. Signed-off-by: MORITA Kazutaka morita.kazut

[Qemu-devel] [PATCH v2 2/9] iov: handle EOF in iov_send_recv

2013-07-24 Thread MORITA Kazutaka
Without this patch, iov_send_recv() never returns when do_send_recv() returns zero. Reviewed-by: Paolo Bonzini pbonz...@redhat.com Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- util/iov.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/util/iov.c b/util/iov.c index

[Qemu-devel] [PATCH v2 8/9] sheepdog: make add_aio_request and send_aioreq void functions

2013-07-24 Thread MORITA Kazutaka
These functions no longer return errors. We can make them void functions and simplify the codes. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 66 +++- 1 file changed, 17 insertions(+), 49 deletions

[Qemu-devel] [PATCH v2 5/9] sheepdog: reload inode outside of resend_aioreq

2013-07-24 Thread MORITA Kazutaka
This prepares for using resend_aioreq() after reconnecting to the sheepdog server. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 33 +++-- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/block/sheepdog.c b/block

Re: [Qemu-devel] [sheepdog] [PATCH v2 0/9] sheepdog: reconnect server after connection failure

2013-07-24 Thread MORITA Kazutaka
At Wed, 24 Jul 2013 16:28:30 +0800, Liu Yuan wrote: On Wed, Jul 24, 2013 at 04:56:24PM +0900, MORITA Kazutaka wrote: Currently, if a sheepdog server exits, all the connecting VMs need to be restarted. This series implements a feature to reconnect the server, and enables us to do online

Re: [Qemu-devel] [sheepdog] [PATCH v2 0/9] sheepdog: reconnect server after connection failure

2013-07-24 Thread MORITA Kazutaka
At Thu, 25 Jul 2013 13:25:33 +0800, Liu Yuan wrote: Hello Kazutaka, I have two patches fixing the problems I found on my testing and they are complementary patches. Please consider sending them on top of your patch set. Thanks a lot for your comments and patches, but I've already

[Qemu-devel] [PATCH 09/11] sheepdog: try to reconnect to sheepdog after network error

2013-07-23 Thread MORITA Kazutaka
This introduces a failed request queue and links all the inflight requests to the list after network error happens. After QEMU reconnects to the sheepdog server successfully, the sheepdog block driver will retry all the requests in the failed queue. Signed-off-by: MORITA Kazutaka morita.kazut

[Qemu-devel] [PATCH 03/11] qemu-sockets: make wait_for_connect be invoked in qemu_aio_wait

2013-07-23 Thread MORITA Kazutaka
This allows us to use inet_nonblocking_connect() and unix_nonblocking_connect() in block drivers. qemu-ga needs to link block-obj to resolve dependencies of qemu_aio_set_fd_handler(). Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- Makefile| 4 ++-- util/qemu

[Qemu-devel] [PATCH 06/11] sheepdog: handle vdi objects in resend_aio_req

2013-07-23 Thread MORITA Kazutaka
The current resend_aio_req() doesn't work when the request is against vdi objects. This fixes the problem. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/block

[Qemu-devel] [PATCH 11/11] sheepdog: cancel aio requests if possible

2013-07-23 Thread MORITA Kazutaka
This patch tries to cancel aio requests in pending queue and failed queue. When the sheepdog driver cannot cancel the requests, it waits for them to be completed. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 70

[Qemu-devel] [PATCH 08/11] coroutine: add co_aio_sleep_ns() to allow sleep in block drivers

2013-07-23 Thread MORITA Kazutaka
This helper function behaves similarly to co_sleep_ns(), but the sleeping coroutine will be resumed when using qemu_aio_wait(). Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- include/block/coroutine.h | 8 qemu-coroutine-sleep.c| 47

[Qemu-devel] [PATCH 07/11] sheepdog: reload inode outside of resend_aioreq

2013-07-23 Thread MORITA Kazutaka
This prepares for using resend_aioreq() after reconnecting to the sheepdog server. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 33 +++-- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/block/sheepdog.c b/block

[Qemu-devel] [PATCH 04/11] sheepdog: make connect nonblocking

2013-07-23 Thread MORITA Kazutaka
This uses nonblocking connect functions to connect to the sheepdog server. The connect operation is done in a coroutine function and it will be yielded until the created socked is ready for IO. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 70

[Qemu-devel] [PATCH 10/11] sheepdog: make add_aio_request and send_aioreq void functions

2013-07-23 Thread MORITA Kazutaka
These functions no longer return errors. We can make them void functions and simplify the codes. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 66 +++- 1 file changed, 17 insertions(+), 49 deletions

[Qemu-devel] [PATCH 02/11] iov: handle EOF in iov_send_recv

2013-07-23 Thread MORITA Kazutaka
Without this patch, iov_send_recv() never returns when do_send_recv() returns zero. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- util/iov.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/util/iov.c b/util/iov.c index cc6e837..f705586 100644 --- a/util/iov.c +++ b

[Qemu-devel] [PATCH 05/11] sheepdog: check return values of qemu_co_recv/send correctly

2013-07-23 Thread MORITA Kazutaka
qemu_co_recv/send return shorter length on error. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index 6f5ede4..567f52e 100644 --- a/block/sheepdog.c

[Qemu-devel] [PATCH 01/11] ignore SIGPIPE in qemu-img and qemu-io

2013-07-23 Thread MORITA Kazutaka
This prevents the tools from being stopped when they write data to a closed connection in the other side. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- qemu-img.c | 4 qemu-io.c | 4 2 files changed, 8 insertions(+) diff --git a/qemu-img.c b/qemu-img.c index

[Qemu-devel] [PATCH 00/11] sheepdog: reconnect server after connection failure

2013-07-23 Thread MORITA Kazutaka
Currently, if a sheepdog server exits, all the connecting VMs need to be restarted. This series implements a feature to reconnect the server, and enables us to do online sheepdog upgrade and avoid restarting VMs when sheepdog servers crash unexpectedly. MORITA Kazutaka (11): ignore SIGPIPE

Re: [Qemu-devel] block: Review of .has_zero_init use

2013-06-25 Thread MORITA Kazutaka
At Tue, 25 Jun 2013 13:39:11 +0200, Kevin Wolf wrote: Hi all, while discussing some iscsi patches with Peter, we came to have a look at which block drivers implement has_zero_init() to return 0, and which don't (returning 1 is the default). The meaning of this value is that if

Re: [Qemu-devel] block: Review of .has_zero_init use

2013-06-25 Thread MORITA Kazutaka
At Tue, 25 Jun 2013 15:20:18 +0200, Kevin Wolf wrote: Am 25.06.2013 um 15:11 hat MORITA Kazutaka geschrieben: At Tue, 25 Jun 2013 13:39:11 +0200, Kevin Wolf wrote: Hi all, while discussing some iscsi patches with Peter, we came to have a look at which block drivers

Re: [Qemu-devel] [sheepdog] [PATCH v2] sheepdog: fix loadvm operation

2013-04-25 Thread MORITA Kazutaka
At Thu, 25 Apr 2013 12:12:58 +0800, Liu Yuan wrote: On 04/25/2013 12:47 AM, Liu Yuan wrote: - don't break old behavior if we boot up on the snapshot by using s-reverted to indicate if we delete working VDI successfully If we implement 'boot from snapshot' == loadvm snapshot, we

Re: [Qemu-devel] [sheepdog] [PATCH v3] sheepdog: fix loadvm operation

2013-04-25 Thread MORITA Kazutaka
At Thu, 25 Apr 2013 16:42:34 +0800, Liu Yuan wrote: +/* Delete current working VDI on the snapshot chain */ +static bool sd_delete(BDRVSheepdogState *s) +{ +unsigned int wlen = SD_MAX_VDI_LEN, rlen = 0; +SheepdogVdiReq hdr = { +.opcode = SD_OP_DEL_VDI, +.vdi_id =

Re: [Qemu-devel] [sheepdog] [PATCH v3] sheepdog: fix loadvm operation

2013-04-25 Thread MORITA Kazutaka
At Thu, 25 Apr 2013 17:44:41 +0800, Liu Yuan wrote: On 04/25/2013 05:40 PM, MORITA Kazutaka wrote: Isn't it better to show an error message when the result code is SD_RES_NO_VDI? This information isn't useful even for debugging, what it for? The block driver tries to delete the vdi

[Qemu-devel] [PATCH 2/3] sheepdog: add SD_RES_READONLY result code

2013-04-25 Thread MORITA Kazutaka
Sheepdog returns SD_RES_READONLY when qemu sends write requests to the snapshot vdi. This adds the result code and makes sd_strerror() print its error reason. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c |2 ++ 1 files changed, 2 insertions(+), 0

[Qemu-devel] [PATCH 1/3] sheepdog: cleanup find_vdi_name

2013-04-25 Thread MORITA Kazutaka
This makes 'filename' and 'tag' constant variables, and renames 'for_snapshot' to 'lock' to clear how it works. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 15 --- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/block

[Qemu-devel] [PATCH 3/3] sheepdog: resend write requests when SD_RES_READONLY is received

2013-04-25 Thread MORITA Kazutaka
When a snapshot is taken from out side of qemu (e.g. qemu-img snapshot), write requests to the current vdi return SD_RES_READONLY. In this case, the sheepdog block driver needs to update the current inode to the latest one and resend the write requests. Signed-off-by: MORITA Kazutaka morita.kazut

[Qemu-devel] [PATCH 0/3] sheepdog: support online snapshot from qemu-img

2013-04-25 Thread MORITA Kazutaka
Currently, we can take sheepdog snapshots of running VMs only from the qemu monitor. This series allows taking online snapshots from qemu-img. The first two patches prepare for the thrid patch. MORITA Kazutaka (3): sheepdog: cleanup find_vdi_name sheepdog: add SD_RES_READONLY result code

Re: [Qemu-devel] [sheepdog] [PATCH v4] sheepdog: fix loadvm operation

2013-04-25 Thread MORITA Kazutaka
to create a new working VDI based on the snapshot The snapshot chain for above example will be: base -- snap1 -- snap2 ^ | working VDI Cc: qemu-devel@nongnu.org Cc: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp Cc: Kevin Wolf kw...@redhat.com Cc: Stefan Hajnoczi

[Qemu-devel] [PATCH v2 4/4] sheepdog: resend write requests when SD_RES_READONLY is received

2013-04-25 Thread MORITA Kazutaka
When a snapshot is taken from out side of qemu (e.g. qemu-img snapshot), write requests to the current vdi return SD_RES_READONLY. In this case, the sheepdog block driver needs to update the current inode to the latest one and resend the write requests. Signed-off-by: MORITA Kazutaka morita.kazut

[Qemu-devel] [PATCH v2 1/4] sheepdog: cleanup find_vdi_name

2013-04-25 Thread MORITA Kazutaka
This makes 'filename' and 'tag' constant variables, and renames 'for_snapshot' to 'lock' to clear how it works. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 15 --- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/block

[Qemu-devel] [PATCH v2 3/4] sheepdog: add helper function to reload inode

2013-04-25 Thread MORITA Kazutaka
This adds a helper function to update the current inode state with the specified vdi object. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 67 +++-- 1 files changed, 39 insertions(+), 28 deletions(-) diff

[Qemu-devel] [PATCH v2 2/4] sheepdog: add SD_RES_READONLY result code

2013-04-25 Thread MORITA Kazutaka
Sheepdog returns SD_RES_READONLY when qemu sends write requests to the snapshot vdi. This adds the result code and makes sd_strerror() print its error reason. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c |2 ++ 1 files changed, 2 insertions(+), 0

[Qemu-devel] [PATCH v2 0/4] sheepdog: support online snapshot from qemu-img

2013-04-25 Thread MORITA Kazutaka
. This series allows taking online snapshots from qemu-img. The first two patches prepare for the thrid patch. MORITA Kazutaka (4): sheepdog: cleanup find_vdi_name sheepdog: add SD_RES_READONLY result code sheepdog: add helper function to reload inode sheepdog: resend write requests when

Re: [Qemu-devel] [sheepdog] [PATCH 3/3] sheepdog: resend write requests when SD_RES_READONLY is received

2013-04-25 Thread MORITA Kazutaka
At Thu, 25 Apr 2013 21:08:01 +0800, Liu Yuan wrote: On 04/25/2013 06:37 PM, MORITA Kazutaka wrote: +/* update inode with the latest state */ +static int coroutine_fn reload_vdi_object(BDRVSheepdogState *s) I'd suggest function name as 'reload_inode(BDRVSheepdogState *s, tag, snapid

Re: [Qemu-devel] [sheepdog] [PATCH] sheepdog: implement .bdrv_co_is_allocated

2013-04-22 Thread MORITA Kazutaka
At Thu, 18 Apr 2013 19:48:52 +0800, Liu Yuan wrote: +static coroutine_fn int +sd_co_is_allocated(BlockDriverState *bs, int64_t sector_num, int nb_sectors, + int *pnum) +{ +BDRVSheepdogState *s = bs-opaque; +SheepdogInode *inode = s-inode; +unsigned long start

Re: [Qemu-devel] [sheepdog] [PATCH for QEMU v3] sheepdog: add discard/trim support for sheepdog

2013-04-15 Thread MORITA Kazutaka
At Sun, 14 Apr 2013 13:16:44 +0800, Liu Yuan wrote: From: Liu Yuan tailai...@taobao.com The 'TRIM' command from VM that is to release underlying data storage for better thin-provision is already supported by the Sheepdog. This patch adds the TRIM support at QEMU part. For older

Re: [Qemu-devel] [sheepdog] [PATCH v4] sheepdog: add discard/trim support for sheepdog

2013-04-15 Thread MORITA Kazutaka
At Mon, 15 Apr 2013 23:52:40 +0800, Liu Yuan wrote: diff --git a/block/sheepdog.c b/block/sheepdog.c index 987018e..362244a 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -34,6 +34,7 @@ #define SD_OP_GET_VDI_INFO 0x14 #define SD_OP_READ_VDIS 0x15 #define

Re: [Qemu-devel] [sheepdog] [PATCH v5] sheepdog: add discard/trim support for sheepdog

2013-04-15 Thread MORITA Kazutaka
Sheepdog that doesn't support it, we return 0(success) to upper layer. Cc: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp Cc: Kevin Wolf kw...@redhat.com Cc: Stefan Hajnoczi stefa...@redhat.com Cc: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Liu Yuan tailai...@taobao.com --- v5: - adjust

Re: [Qemu-devel] [PATCH] sheepdog: show error message for halt status

2013-03-18 Thread MORITA Kazutaka
currently doesn't recognize it. This patch adds an error description when QEMU client receives it, other than plainly printing 'Invalid error code' Cc: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp Cc: Kevin Wolf kw...@redhat.com Cc: Stefan Hajnoczi stefa...@redhat.com Signed-off-by: Liu Yuan

[Qemu-devel] [PATCH v2 0/2] sheepdog: don't sleep in coroutine context

2013-03-12 Thread MORITA Kazutaka
it is safe to io_flush to NULL MORITA Kazutaka (2): sheepdog: use non-blocking fd in coroutine context sheepdog: set io_flush handler in do_co_req block/sheepdog.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) -- 1.8.1.3.566.gaa39828

[Qemu-devel] [PATCH v2 1/2] sheepdog: use non-blocking fd in coroutine context

2013-03-12 Thread MORITA Kazutaka
Using a blocking socket in the coroutine context reduces the chance of switching to other work. This patch makes the sheepdog driver use a non-blocking fd always. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 6 ++ 1 file changed, 2 insertions(+), 4

[Qemu-devel] [PATCH v2 2/2] sheepdog: set io_flush handler in do_co_req

2013-03-12 Thread MORITA Kazutaka
If an io_flush handler is not set, qemu_aio_wait doesn't invoke callbacks. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index 27abef2

[Qemu-devel] [PATCH] sheepdog: set io_flush handler in do_co_req

2013-03-11 Thread MORITA Kazutaka
If an io_flush handler is not set, qemu_aio_wait doesn't invoke callbacks. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index e4ec32d..cb0eeed

  1   2   3   >