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

[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] [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

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 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

[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] [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 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

[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

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

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] [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] 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] 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] bdrv_flush for qemu block drivers nbd, rbd and sheepdog

2010-10-21 Thread MORITA Kazutaka
At Thu, 21 Oct 2010 16:07:28 +0200, Kevin Wolf wrote: Hi all, I'm currently looking into adding a return value to qemu's bdrv_flush function and I noticed that your block drivers (nbd, rbd and sheepdog) don't implement bdrv_flush at all. bdrv_flush is going to return -ENOTSUP for any

Re: [Qemu-devel] bdrv_flush for qemu block drivers nbd, rbd and sheepdog

2010-10-24 Thread MORITA Kazutaka
At Fri, 22 Oct 2010 10:47:44 +0200, Kevin Wolf wrote: Am 22.10.2010 07:43, schrieb MORITA Kazutaka: At Thu, 21 Oct 2010 16:07:28 +0200, Kevin Wolf wrote: Hi all, I'm currently looking into adding a return value to qemu's bdrv_flush function and I noticed that your block drivers

[Qemu-devel] [PATCH][qemu-iotests] add support for rbd and sheepdog protocols

2011-01-17 Thread MORITA Kazutaka
This patch introduces tests for protocols other than file, and initially supports rbd and sheepdog. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- 001 |1 + 002 |1 + 003 |1 + 004 |1 + 005 |6 ++ 006 |1 + 007

[Qemu-devel] [PATCH] sheepdog: support creating images on remote hosts

2011-01-27 Thread MORITA Kazutaka
This patch parses the input filename in sd_create(), and enables us specifying a target server to create sheepdog images. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 17 ++--- 1 files changed, 14 insertions(+), 3 deletions(-) diff --git

[Qemu-devel] [PATCH] Documentation: add Sheepdog disk images

2011-02-07 Thread MORITA Kazutaka
Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- qemu-doc.texi | 52 1 files changed, 52 insertions(+), 0 deletions(-) diff --git a/qemu-doc.texi b/qemu-doc.texi index 22a8663..86e017c 100644 --- a/qemu-doc.texi +++ b/qemu

Re: [Qemu-devel] Re: [PATCH 3/3] block/nbd: Make the NBD block device use the AIO interface

2011-02-22 Thread MORITA Kazutaka
At Mon, 21 Feb 2011 17:48:49 +0100, Kevin Wolf wrote: Am 21.02.2011 17:31, schrieb Nicholas Thomas: Hi again, Thanks for looking through the patches. I'm just going through and making the suggested changes now. I've also got qemu-nbd and block/nbd.c working over IPv6 :) - hopefully

[Qemu-devel] [RFC PATCH 1/2] close all the block drivers before the qemu process exits

2010-05-12 Thread MORITA Kazutaka
This patch calls the close handler of the block driver before the qemu process exits. This is necessary because the sheepdog block driver releases the lock of VM images in the close handler. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block.c | 11 +++ block.h

[Qemu-devel] [RFC PATCH 0/2] Sheepdog: distributed storage system for QEMU

2010-05-12 Thread MORITA Kazutaka
Thanks, Kazutaka [1] http://www.osrg.net/sheepdog/ [2] http://lists.nongnu.org/archive/html/qemu-devel/2009-10/msg01773.html MORITA Kazutaka (2): close all the block drivers before the qemu process exits block: add sheepdog driver for distributed storage support Makefile |2

[Qemu-devel] [RFC PATCH 2/2] block: add sheepdog driver for distributed storage support

2010-05-12 Thread MORITA Kazutaka
/sheepdog/ Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- Makefile |2 +- block.c |3 +- block/sheepdog.c | 1828 ++ 3 files changed, 1831 insertions(+), 2 deletions(-) create mode 100644 block

[Qemu-devel] Re: [RFC PATCH 1/2] close all the block drivers before the qemu process exits

2010-05-12 Thread MORITA Kazutaka
At Thu, 13 May 2010 05:16:35 +0900, MORITA Kazutaka wrote: On 2010/05/12 23:28, Avi Kivity wrote: On 05/12/2010 01:46 PM, MORITA Kazutaka wrote: This patch calls the close handler of the block driver before the qemu process exits. This is necessary because the sheepdog block driver

[Qemu-devel] Re: [RFC PATCH 1/2] close all the block drivers before the qemu process exits

2010-05-12 Thread MORITA Kazutaka
On 2010/05/12 23:28, Avi Kivity wrote: On 05/12/2010 01:46 PM, MORITA Kazutaka wrote: This patch calls the close handler of the block driver before the qemu process exits. This is necessary because the sheepdog block driver releases the lock of VM images in the close handler. How do

Re: [Qemu-devel] [RFC PATCH 0/2] Sheepdog: distributed storage system for QEMU

2010-05-12 Thread MORITA Kazutaka
On 2010/05/12 20:38, Kevin Wolf wrote: Am 12.05.2010 12:46, schrieb MORITA Kazutaka: Hi all, This patch adds a block driver for Sheepdog distributed storage system. Please consider for inclusion. Sheepdog is a distributed storage system for QEMU. It provides highly available block level

Re: [Qemu-devel] [RFC PATCH 1/2] close all the block drivers before the qemu process exits

2010-05-12 Thread MORITA Kazutaka
On 2010/05/12 23:01, Christoph Hellwig wrote: On Wed, May 12, 2010 at 07:46:52PM +0900, MORITA Kazutaka wrote: This patch calls the close handler of the block driver before the qemu process exits. This is necessary because the sheepdog block driver releases the lock of VM images in the close

Re: [Qemu-devel] [RFC PATCH 0/2] Sheepdog: distributed storage system for QEMU

2010-05-13 Thread MORITA Kazutaka
At Thu, 13 May 2010 04:46:46 +0900, MORITA Kazutaka wrote: On 2010/05/12 20:38, Kevin Wolf wrote: I'll have a closer look at your code later, but one thing I noticed is that the new block driver is something in between a protocol and a format driver (just like vvfat, which should stop

[Qemu-devel] [RFC PATCH v2 1/3] close all the block drivers before the qemu process exits

2010-05-14 Thread MORITA Kazutaka
This patch calls the close handler of the block driver before the qemu process exits. This is necessary because the sheepdog block driver releases the lock of VM images in the close handler. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block.c |9 + block.h

[Qemu-devel] [RFC PATCH v2 2/3] block: call the snapshot handlers of the protocol drivers

2010-05-14 Thread MORITA Kazutaka
When snapshot handlers of the format driver is not defined, it is better to call the ones of the protocol driver. This enables us to implement snapshot support in the protocol driver. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block.c | 48

[Qemu-devel] [RFC PATCH v2 0/3] Sheepdog: distributed storage system for QEMU

2010-05-14 Thread MORITA Kazutaka
-b sheepdog:vol1:1 -f sheepdog vol2 Thanks, Kazutaka MORITA Kazutaka (3): close all the block drivers before the qemu process exits block: call the snapshot handlers of the protocol drivers block: add sheepdog driver for distributed storage support Makefile.objs|2 +- block.c

Re: [Qemu-devel] [RFC PATCH 0/2] Sheepdog: distributed storage system for QEMU

2010-05-14 Thread MORITA Kazutaka
At Fri, 14 May 2010 10:32:26 +0200, Kevin Wolf wrote: Am 13.05.2010 16:03, schrieb MORITA Kazutaka: To support snapshot in a protocol, I'd like to call the hander of the protocol driver in the following functions in block.c: bdrv_snapshot_create bdrv_snapshot_goto

[Qemu-devel] [RFC PATCH v3 2/3] block: call the snapshot handlers of the protocol drivers

2010-05-17 Thread MORITA Kazutaka
() call of the protocol. It is because the contents of the block driver state may need to be changed after loading vmstate. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block.c | 61 +++-- 1 files changed, 43 insertions

[Qemu-devel] [RFC PATCH v3 1/3] close all the block drivers before the qemu process exits

2010-05-17 Thread MORITA Kazutaka
This patch calls the close handler of the block driver before the qemu process exits. This is necessary because the sheepdog block driver releases the lock of VM images in the close handler. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block.c |9 + block.h

[Qemu-devel] [RFC PATCH v3 0/3] Sheepdog: distributed storage system for QEMU

2010-05-17 Thread MORITA Kazutaka
of the protocol driver. Thanks, Kazutaka MORITA Kazutaka (3): close all the block drivers before the qemu process exits block: call the snapshot handlers of the protocol drivers block: add sheepdog driver for distributed storage support Makefile.objs|2 +- block.c | 70

[Qemu-devel] [RFC PATCH v3 3/3] block: add sheepdog driver for distributed storage support

2010-05-17 Thread MORITA Kazutaka
/sheepdog/ Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- Makefile.objs|2 +- block/sheepdog.c | 1845 ++ 2 files changed, 1846 insertions(+), 1 deletions(-) create mode 100644 block/sheepdog.c diff --git

[Qemu-devel] Re: [RFC PATCH v2 3/3] block: add sheepdog driver for distributed storage support

2010-05-17 Thread MORITA Kazutaka
Hi, Thank you very much for the reviewing! At Fri, 14 May 2010 13:08:06 +0200, Kevin Wolf wrote: + +struct sd_req { + uint8_t proto_ver; + uint8_t opcode; + uint16_tflags; + uint32_tepoch; + uint32_tid; + uint32_t

[Qemu-devel] Re: [RFC PATCH v3 2/3] block: call the snapshot handlers of the protocol drivers

2010-05-17 Thread MORITA Kazutaka
At Mon, 17 May 2010 13:08:08 +0200, Kevin Wolf wrote: Am 17.05.2010 12:19, schrieb MORITA Kazutaka: int bdrv_snapshot_goto(BlockDriverState *bs, const char *snapshot_id) { BlockDriver *drv = bs-drv; +int ret, open_ret; + if (!drv

  1   2   3   >