[Qemu-devel] [PATCH] sheepdog: fix co_recv coroutine context

2012-01-31 Thread MORITA Kazutaka
make the sheepdog driver fully coroutine-based and simplify request handling. Signed-off-by: MORITA Kazutaka --- block/sheepdog.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index 9416400..00276f6f 100644 --- a/block/sheepdog.c +++ b

[Qemu-devel] [PATCH 6/6] sheepdog: traverse pending_list from the first for each time

2012-06-26 Thread MORITA Kazutaka
The pending list can be modified in other coroutine context sd_co_rw_vector, so we need to traverse the list from the first again after we send the pending request. Signed-off-by: MORITA Kazutaka --- block/sheepdog.c | 22 -- 1 files changed, 16 insertions(+), 6 deletions

[Qemu-devel] [PATCH 3/6] sheepdog: use coroutine based socket functions in coroutine context

2012-06-26 Thread MORITA Kazutaka
This removes blocking network I/Os in coroutine context. Signed-off-by: MORITA Kazutaka --- block/sheepdog.c | 10 -- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index 0b49c6d..5dc1d7a 100644 --- a/block/sheepdog.c +++ b/block

[Qemu-devel] [PATCH 0/6] sheepdog: various fixes

2012-06-26 Thread MORITA Kazutaka
See individual patches for details. MORITA Kazutaka (6): sheepdog: fix dprintf format strings sheepdog: restart I/O when socket becomes ready in do_co_req() sheepdog: use coroutine based socket functions in coroutine context sheepdog: make sure we don't free aiocb before sendin

[Qemu-devel] [PATCH 1/6] sheepdog: fix dprintf format strings

2012-06-26 Thread MORITA Kazutaka
This fixes warnings about dprintf format in debug mode. Signed-off-by: MORITA Kazutaka --- block/sheepdog.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index 8877f45..afd06aa 100644 --- a/block/sheepdog.c +++ b/block

[Qemu-devel] [PATCH 4/6] sheepdog: make sure we don't free aiocb before sending all requests

2012-06-26 Thread MORITA Kazutaka
This patch increments the pending counter before sending requests, and make sures that aiocb is not freed while sending them. Signed-off-by: MORITA Kazutaka --- block/sheepdog.c | 29 - 1 files changed, 16 insertions(+), 13 deletions(-) diff --git a/block

[Qemu-devel] [PATCH 5/6] sheepdog: split outstanding list into inflight and pending

2012-06-26 Thread MORITA Kazutaka
outstanding_list_head is used for both pending and inflight requests. This patch splits it and improves readability. Signed-off-by: MORITA Kazutaka --- block/sheepdog.c | 49 - 1 files changed, 24 insertions(+), 25 deletions(-) diff --git a

[Qemu-devel] [PATCH 2/6] sheepdog: restart I/O when socket becomes ready in do_co_req()

2012-06-26 Thread MORITA Kazutaka
Currently, no one reenters the yielded coroutine. This fixes it. Signed-off-by: MORITA Kazutaka --- block/sheepdog.c | 14 ++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index afd06aa..0b49c6d 100644 --- a/block/sheepdog.c

Re: [Qemu-devel] [sheepdog] [PATCH] sheepdog: do not blindly memset all read buffers

2012-06-28 Thread MORITA Kazutaka
At Wed, 27 Jun 2012 18:22:58 +0200, Christoph Hellwig wrote: > > Only buffers that map to unallocated blocks need to be zeroed. > > Signed-off-by: Christoph Hellwig > > Index: qemu/block/sheepdog.c > === > --- qemu.orig/block/sheep

Re: [Qemu-devel] [sheepdog] [PATCH] sheepdog: do not blindly memset all read buffers

2012-07-02 Thread MORITA Kazutaka
At Fri, 29 Jun 2012 17:38:24 +0200, Christoph Hellwig wrote: > > > > > goto done; > > > } > > > - > > > -create = 1; > > > -} else if (acb->aiocb_type == AIOCB_WRITE_UDATA > > > - && !is_data_obj_writable(inode, idx)) { > > > -

Re: [Qemu-devel] [PATCH 3/6] sheepdog: use coroutine based socket functions in coroutine context

2012-07-04 Thread MORITA Kazutaka
At Tue, 03 Jul 2012 15:15:03 +0200, Kevin Wolf wrote: > > Am 27.06.2012 00:26, schrieb MORITA Kazutaka: > > This removes blocking network I/Os in coroutine context. > > > > Signed-off-by: MORITA Kazutaka > > --- > > block/sheepdog.c | 10 -- >

[Qemu-devel] [PATCH] sheepdog: always use coroutine-based network functions

2012-07-04 Thread MORITA Kazutaka
This reduces some code duplication. Signed-off-by: MORITA Kazutaka --- block/sheepdog.c | 113 ++--- 1 files changed, 47 insertions(+), 66 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index 6e73efb..4958672 100644 --- a/block

Re: [Qemu-devel] [sheepdog] [PATCH v2] sheepdog: do not blindly memset all read buffers

2012-07-09 Thread MORITA Kazutaka
At Sun, 8 Jul 2012 21:33:16 +0200, Christoph Hellwig wrote: > > Only buffers that map to unallocated blocks need to be zeroed. > > Signed-off-by: Christoph Hellwig > > --- > block/sheepdog.c | 28 ++-- > 1 file changed, 18 insertions(+), 10 deletions(-) > > Index: qe

Re: [Qemu-devel] [PATCH v3] sheepdog: do not blindly memset all read buffers

2012-07-09 Thread MORITA Kazutaka
ertions(+), 19 deletions(-) Acked-by: MORITA Kazutaka

Re: [Qemu-devel] [PATCH v4] sheepdog: do not blindly memset all read buffers

2012-07-10 Thread MORITA Kazutaka
ertions(+), 19 deletions(-) Acked-by: MORITA Kazutaka

Re: [Qemu-devel] [PATCH Update] sheepdog: don't update inode when create_and_write fails

2012-12-16 Thread MORITA Kazutaka
result in VM's IO error on the failed object. > > Cc: MORITA Kazutaka > Cc: Kevin Wolf > Signed-off-by: Liu Yuan > --- > Update > - update the coding style and passed checkpath > > block/sheepdog.c | 12 +++- > 1 file changed, 7 insertions(+), 5

Re: [Qemu-devel] [PATCH Update] sheepdog: don't update inode when create_and_write fails

2012-12-16 Thread MORITA Kazutaka
At Mon, 17 Dec 2012 13:22:31 +0800, Liu Yuan wrote: > > On 12/17/2012 11:43 AM, MORITA Kazutaka wrote: > > send_pending_req() needs to be called even in error case. Rather than > > moving the error check, I think it looks better to update > > s->inode.data_vdi

Re: [Qemu-devel] [PATCH v2 2/2] sheepdog: pass oid directly to send_pending_req()

2012-12-16 Thread MORITA Kazutaka
At Mon, 17 Dec 2012 14:17:27 +0800, Liu Yuan wrote: > > From: Liu Yuan > > Cc: MORITA Kazutaka > Cc: Kevin Wolf > Signed-off-by: Liu Yuan > --- > block/sheepdog.c |2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: MORITA Kazutaka

Re: [Qemu-devel] [PATCH v2 1/2] sheepdog: don't update inode when create_and_write fails

2012-12-16 Thread MORITA Kazutaka
result in VM's IO error on the failed object. > > Cc: MORITA Kazutaka > Cc: Kevin Wolf > Signed-off-by: Liu Yuan > --- > block/sheepdog.c |9 + > 1 file changed, 5 insertions(+), 4 deletions(-) Reviewed-by: MORITA Kazutaka

Re: [Qemu-devel] [PATCH] sheepdog: implement direct write semantics

2012-12-24 Thread MORITA Kazutaka
At Thu, 20 Dec 2012 02:29:31 +0800, Liu Yuan wrote: > > From: Liu Yuan > > Sheepdog supports both writeback/writethrough write but has not yet supported > DIRECTIO semantics which bypass the cache completely even if Sheepdog daemon > is > set up with cache enabled. > > Suppose cache is enabled

Re: [Qemu-devel] [Openstack][Sheepdog][Libvirt][Qemu]Add a new block storage driver by Libvirt/Qemu way for Openstack

2013-01-25 Thread MORITA Kazutaka
At Fri, 25 Jan 2013 19:05:06 +0800, harryxiyou wrote: > > On Sat, Jan 19, 2013 at 10:04 PM, MORITA Kazutaka > wrote: > [...] > > If you do the above work, I think you can use your file system with > > OpenStack. > > > > But I suggest doing them step

Re: [Qemu-devel] [Libvirt][QEMU][HLFS]How to test HLFS driver for Libvirt

2013-01-28 Thread MORITA Kazutaka
At Mon, 28 Jan 2013 21:18:42 +0800, harryxiyou wrote: > > Hi Morita and other developers, > > I have programed HLFS(HDFS based Log-structured FileSystem) driver for Libvirt > according to Morita's patch(commit 036ad5052b43fe9f0d197e89fd16715950408e1d) > for Libvirt, which my patch is not for Libv

Re: [Qemu-devel] [Libvirt][QEMU][HLFS]How to test HLFS driver for Libvirt

2013-01-28 Thread MORITA Kazutaka
At Mon, 28 Jan 2013 23:43:04 +0800, harryxiyou wrote: > > Following test is Libvirt v0.8.6, which you just add Sheepdog volume > patch to Libvirt. The version doesn't support Sheepdog storage pool and volume. Please note that my patch you are looking at doesn't implements a sheepdog storage driv

[Qemu-devel] [PATCH v3 2/5] move socket_set_nodelay to osdep.c

2013-01-28 Thread MORITA Kazutaka
Signed-off-by: MORITA Kazutaka --- block/sheepdog.c | 11 +-- gdbstub.c |5 ++--- include/qemu/sockets.h |1 + qemu-char.c|6 -- slirp/tcp_subr.c |3 +-- util/osdep.c |6 ++ 6 files changed, 11 insertions(+), 21

[Qemu-devel] [PATCH v3 1/5] slirp/tcp_subr.c: fix coding style in tcp_connect

2013-01-28 Thread MORITA Kazutaka
Fix coding style in tcp_connect before the next patch. Signed-off-by: MORITA Kazutaka --- slirp/tcp_subr.c | 140 -- 1 files changed, 72 insertions(+), 68 deletions(-) diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c index 1542e43..317dc07

[Qemu-devel] [PATCH v3 3/5] sheepdog: accept URIs

2013-01-28 Thread MORITA Kazutaka
The URI syntax is consistent with the NBD and Gluster syntax. The syntax is sheepdog[+tcp]://[host:port]/vdiname[#snapid|#tag] Signed-off-by: MORITA Kazutaka --- block/sheepdog.c | 139 - qemu-doc.texi| 16 +++--- qemu-options.hx

[Qemu-devel] [PATCH v3 5/5] sheepdog: add support for connecting to unix domain socket

2013-01-28 Thread MORITA Kazutaka
This patch adds support for a unix domain socket for a connection between qemu and local sheepdog server. You can use the unix domain socket with the following syntax: $ qemu sheepdog+unix:///?[#snapid] Signed-off-by: MORITA Kazutaka --- block/sheepdog.c | 82

[Qemu-devel] [PATCH v3 0/5] sheepdog: unix domain socket support

2013-01-28 Thread MORITA Kazutaka
set_nodelay to lib/osdep.c - remove redundant error checks - add a bit more explanation to qemu-options.hx MORITA Kazutaka (5): slirp/tcp_subr.c: fix coding style in tcp_connect move socket_set_nodelay to osdep.c sheepdog: accept URIs sheepdog: use inet_connect to simplify connect code

[Qemu-devel] [PATCH v3 4/5] sheepdog: use inet_connect to simplify connect code

2013-01-28 Thread MORITA Kazutaka
This uses the form ":" for the representation of the sheepdog server to use inet_connect. Signed-off-by: MORITA Kazutaka --- block/sheepdog.c | 111 ++--- 1 files changed, 30 insertions(+), 81 deletions(-) diff --git a/block/sheepdog

Re: [Qemu-devel] [PATCH] sheepdog: pass vdi_id to sheep daemon for sd_close()

2013-01-29 Thread MORITA Kazutaka
At Tue, 29 Jan 2013 16:22:49 +0800, Liu Yuan wrote: > > From: Liu Yuan > > Sheep daemon needs vdi_id to identify which vdi is closed to release resources > such as object cache. > > Cc: MORITA Kazutaka > Cc: Kevin Wolf > Cc: Stefan Hajnoczi > Signed-of

Re: [Qemu-devel] [PATCH v3 5/5] sheepdog: add support for connecting to unix domain socket

2013-01-29 Thread MORITA Kazutaka
At Tue, 29 Jan 2013 09:25:13 +0100, Paolo Bonzini wrote: > > Il 29/01/2013 01:11, MORITA Kazutaka ha scritto: > > This patch adds support for a unix domain socket for a connection > > between qemu and local sheepdog server. You can use the unix domain > > socket w

[Qemu-devel] [PATCH v4 1/5] slirp/tcp_subr.c: fix coding style in tcp_connect

2013-01-29 Thread MORITA Kazutaka
Fix coding style in tcp_connect before the next patch. Signed-off-by: MORITA Kazutaka --- slirp/tcp_subr.c | 140 -- 1 files changed, 72 insertions(+), 68 deletions(-) diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c index 1542e43..317dc07

[Qemu-devel] [PATCH v4 5/5] sheepdog: add support for connecting to unix domain socket

2013-01-29 Thread MORITA Kazutaka
This patch adds support for a unix domain socket for a connection between qemu and local sheepdog server. You can use the unix domain socket with the following syntax: $ qemu sheepdog+unix:///?socket=[#snapid] Signed-off-by: MORITA Kazutaka --- block/sheepdog.c | 82

[Qemu-devel] [PATCH v4 4/5] sheepdog: use inet_connect to simplify connect code

2013-01-29 Thread MORITA Kazutaka
This uses the form ":" for the representation of the sheepdog server to use inet_connect. Signed-off-by: MORITA Kazutaka --- block/sheepdog.c | 111 ++--- 1 files changed, 30 insertions(+), 81 deletions(-) diff --git a/block/sheepdog

[Qemu-devel] [PATCH v4 3/5] sheepdog: accept URIs

2013-01-29 Thread MORITA Kazutaka
The URI syntax is consistent with the NBD and Gluster syntax. The syntax is sheepdog[+tcp]://[host:port]/vdiname[#snapid|#tag] Signed-off-by: MORITA Kazutaka --- block/sheepdog.c | 139 - qemu-doc.texi| 16 +++--- qemu-options.hx

[Qemu-devel] [PATCH v4 2/5] move socket_set_nodelay to osdep.c

2013-01-29 Thread MORITA Kazutaka
Signed-off-by: MORITA Kazutaka --- block/sheepdog.c | 11 +-- gdbstub.c |5 ++--- include/qemu/sockets.h |1 + qemu-char.c|6 -- slirp/tcp_subr.c |3 +-- util/osdep.c |6 ++ 6 files changed, 11 insertions(+), 21

Re: [Qemu-devel] [PATCH v2] sheepdog: pass vdi_id to sheep daemon for sd_close()

2013-01-29 Thread MORITA Kazutaka
At Tue, 29 Jan 2013 17:14:16 +0800, Liu Yuan wrote: > > From: Liu Yuan > > Sheep daemon needs vdi_id to identify which vdi is closed to release resources > such as object cache. > > Cc: MORITA Kazutaka > Cc: Kevin Wolf > Cc: Stefan Hajnoczi > Signed-off-by:

[Qemu-devel] [PATCH v4 0/5] sheepdog: unix domain socket support

2013-01-29 Thread MORITA Kazutaka
Changes from v1: - split patch for easy review - move set_nodelay to lib/osdep.c - remove redundant error checks - add a bit more explanation to qemu-options.hx MORITA Kazutaka (5): slirp/tcp_subr.c: fix coding style in tcp_connect move socket_set_nodelay to osdep.c sheepdog: accept URIs

Re: [Qemu-devel] [PATCH v4 4/5] sheepdog: use inet_connect to simplify connect code

2013-01-29 Thread MORITA Kazutaka
At Tue, 29 Jan 2013 10:11:44 -0700, Eric Blake wrote: > > On 01/29/2013 01:56 AM, MORITA Kazutaka wrote: > > This uses the form ":" for the representation of the > > sheepdog server to use inet_connect. > > > > Signed-off-by: MORITA Kazuta

[Qemu-devel] [PATCH v4 RESEND 3/5] sheepdog: accept URIs

2013-02-21 Thread MORITA Kazutaka
The URI syntax is consistent with the NBD and Gluster syntax. The syntax is sheepdog[+tcp]://[host:port]/vdiname[#snapid|#tag] Signed-off-by: MORITA Kazutaka --- block/sheepdog.c | 139 +-- qemu-doc.texi| 16 +++ qemu-options.hx

[Qemu-devel] [PATCH v4 RESEND 2/5] move socket_set_nodelay to osdep.c

2013-02-21 Thread MORITA Kazutaka
Signed-off-by: MORITA Kazutaka --- block/sheepdog.c | 11 +-- gdbstub.c | 5 ++--- include/qemu/sockets.h | 1 + qemu-char.c| 6 -- slirp/tcp_subr.c | 3 +-- util/osdep.c | 6 ++ 6 files changed, 11 insertions(+), 21 deletions

[Qemu-devel] [PATCH v4 RESEND 1/5] slirp/tcp_subr.c: fix coding style in tcp_connect

2013-02-21 Thread MORITA Kazutaka
Fix coding style in tcp_connect before the next patch. Signed-off-by: MORITA Kazutaka --- slirp/tcp_subr.c | 140 --- 1 file changed, 72 insertions(+), 68 deletions(-) diff --git a/slirp/tcp_subr.c b/slirp/tcp_subr.c index 1542e43..317dc07

[Qemu-devel] [PATCH v4 RESEND 5/5] sheepdog: add support for connecting to unix domain socket

2013-02-21 Thread MORITA Kazutaka
This patch adds support for a unix domain socket for a connection between qemu and local sheepdog server. You can use the unix domain socket with the following syntax: $ qemu sheepdog+unix:///?socket=[#snapid] Signed-off-by: MORITA Kazutaka --- block/sheepdog.c | 82

[Qemu-devel] [PATCH v4 RESEND 4/5] sheepdog: use inet_connect to simplify connect code

2013-02-21 Thread MORITA Kazutaka
This uses the form ":" for the representation of the sheepdog server to use inet_connect. Signed-off-by: MORITA Kazutaka --- block/sheepdog.c | 111 +++ 1 file changed, 30 insertions(+), 81 deletions(-) diff --git a/block/sheepdog

[Qemu-devel] [PATCH v4 RESEND 0/5] sheepdog: unix domain socket support

2013-02-21 Thread MORITA Kazutaka
Changes from v1: - split patch for easy review - move set_nodelay to lib/osdep.c - remove redundant error checks - add a bit more explanation to qemu-options.hx MORITA Kazutaka (5): slirp/tcp_subr.c: fix coding style in tcp_connect move socket_set_nodelay to osdep.c sheepdog: accept URIs

[Qemu-devel] [PATCH] sheepdog: use bool for boolean variables

2012-10-06 Thread MORITA Kazutaka
This improves readability. Signed-off-by: MORITA Kazutaka --- block/sheepdog.c | 70 +++--- 1 files changed, 35 insertions(+), 35 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index 4742f8a..3c88c59 100644 --- a/block/sheepdog.c

[Qemu-devel] [PATCH] sheepdog: fix savevm and loadvm

2012-08-29 Thread MORITA Kazutaka
This patch sets data to be sent to Sheepdog correctly and fixes savevm and loadvm operations on a Sheepdog image. Signed-off-by: MORITA Kazutaka --- block/sheepdog.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index df4f441

[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 --- block/sheepdog.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index e4ec32d..cb0eeed 100644 --- a/block/sheep

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

2013-03-11 Thread MORITA Kazutaka
At Mon, 11 Mar 2013 15:39:05 +0100, Stefan Hajnoczi wrote: > > On Mon, Mar 11, 2013 at 06:01:02PM +0900, MORITA Kazutaka wrote: > > If an io_flush handler is not set, qemu_aio_wait doesn't invoke > > callbacks. > > > > Signed-off-by: MORITA Kazutaka

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

2013-03-12 Thread MORITA Kazutaka
hy 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 --- block/sheepdog.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/block

[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 --- block/sheepdog.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index 27abef2..4245328 100644 --- a/

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

2013-03-18 Thread MORITA Kazutaka
which 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 > Cc: Kevin Wolf > Cc: Stefan Hajnoczi > Signed-off-by: Liu Yuan >

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 > > 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 Sheepdog that does

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 SD_OP_

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

2013-04-15 Thread MORITA Kazutaka
t. > > For older Sheepdog that doesn't support it, we return 0(success) to upper > layer. > > Cc: MORITA Kazutaka > Cc: Kevin Wolf > Cc: Stefan Hajnoczi > Cc: Paolo Bonzini > Signed-off-by: Liu Yuan > --- > v5: > - adjust macro numbering > v4: >

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

2013-04-21 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

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 snapsh

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

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

[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 --- block/sheepdog.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/block

[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 --- block/sheepdog.c | 15 --- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/b

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

[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
k(loadvm) operation to the specified snapshot by > 1. switch to the snapshot > 2. delete working VDI > 3. rely on sd_create_branch to create a new working VDI based on the snapshot > > The snapshot chain for above example will be: > > base <-- snap1 <-- snap2 > ^ &

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

[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 --- block/sheepdog.c | 15 --- 1 files changed, 8 insertions(+), 7 deletions(-) diff --git a/b

[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 --- block/sheepdog.c | 67 +++-- 1 files changed, 39 insertions(+), 28 deletions(-) diff --git a/block/sheepdog.c b

[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 --- block/sheepdog.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/block

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

2013-04-25 Thread MORITA Kazutaka
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 > 'r

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 pr

[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 Signed-off-by: MORITA Kazutaka --- 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 v3 10/10] sheepdog: check simultaneous create in resend_aioreq

2013-07-25 Thread MORITA Kazutaka
checks simultaneous create requests more strictly in resend_aioreq(). Signed-off-by: MORITA Kazutaka --- block/sheepdog.c | 64 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index 7bf882a

[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 Signed-off-by: MORITA Kazutaka --- qemu-img.c | 4 qemu-io.c | 4 2 files changed, 8 insertions(+) diff --git a/qemu-img.c b/qemu-img.c index c55ca5c

[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 --- include/block/coroutine.h | 8 qemu-coroutine-sleep.c| 47 +++ 2 files

[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 --- block/sheepdog.c | 66 +++- 1 file changed, 17 insertions(+), 49 deletions(-) diff --git a/block/sheepdog.c b

[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 --- block/sheepdog.c | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c

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

[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 --- block/sheepdog.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index 6a41ad9..c6e9b89 1

[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 --- block/sheepdog.c | 33 +++-- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index fae17ac

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

[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 --- block/sheepdog.c | 70 +++- 1 file changed

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

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

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

2013-07-25 Thread MORITA Kazutaka
ertions(+), 20 deletions(-) Reviewed-by: MORITA Kazutaka

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 se

[Qemu-devel] [PATCH v4 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 Signed-off-by: MORITA Kazutaka --- qemu-img.c | 4 qemu-io.c | 4 2 files changed, 8 insertions(+) diff --git a/qemu-img.c b/qemu-img.c index c55ca5c

[Qemu-devel] [PATCH v4 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 --- include/block/coroutine.h | 8 qemu-coroutine-sleep.c| 47 +++ 2 files

[Qemu-devel] [PATCH v4 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 Signed-off-by: MORITA Kazutaka --- 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 v4 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. Tested-and-reviewed-by: Liu Yuan Signed-off-by: MORITA Kazutaka --- block/sheepdog.c | 33 +++-- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/block/sheepdog.c b

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

2013-07-25 Thread MORITA Kazutaka
checks simultaneous create requests more strictly in resend_aioreq(). Tested-and-reviewed-by: Liu Yuan Signed-off-by: MORITA Kazutaka --- block/sheepdog.c | 64 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/block/sheepdog.c b

[Qemu-devel] [PATCH v4 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. Tested-and-reviewed-by: Liu Yuan Signed-off-by: MORITA Kazutaka --- block/sheepdog.c | 70

[Qemu-devel] [PATCH v4 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. Tested-and-reviewed-by: Liu Yuan Signed-off-by: MORITA Kazutaka --- block/sheepdog.c | 66 +++- 1 file changed, 17 insertions(+), 49 deletions

[Qemu-devel] [PATCH v4 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. Tested-and-reviewed-by: Liu Yuan Signed-off-by: MORITA Kazutaka --- block/sheepdog.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/block/sheepdog.c b/

[Qemu-devel] [PATCH v4 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. Tested-and-reviewed-by: Liu Yuan Signed-off-by: MORITA Kazutaka --- block/sheepdog.c | 21 - 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/

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

2013-07-25 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-25 Thread MORITA Kazutaka
-by: MORITA Kazutaka --- 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/sheepdog.c +++ b/block/sheepdog.c @@ -318,8 +318,11

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

2013-07-29 Thread MORITA Kazutaka
ith > > a number of other source files.) > > > > Signed-off-by: Peter Maydell > > Acked-by: Kevin Wolf > > (CCed Kazutaka in case he has any objections, unexpectedly) No problem. Reviewed-by: MORITA Kazutaka Thanks, Kazutaka

  1   2   3   >