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

2010-05-17 Thread MORITA Kazutaka
On Mon, May 17, 2010 at 9:20 PM, Kevin Wolf kw...@redhat.com wrote: Am 17.05.2010 14:19, schrieb 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

[Qemu-devel] [PATCH] add support for protocol driver create_options

2010-05-19 Thread MORITA Kazutaka
This patch enables protocol drivers to use their create options which are not supported by the format. For example, protcol drivers can use a backing_file option with raw format. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block.c |7 +++ block.h |1

Re: [Qemu-devel] [RFC PATCH 1/1] ceph/rbd block driver for qemu-kvm

2010-05-20 Thread MORITA Kazutaka
At Fri, 21 May 2010 00:16:46 +0200, Christian Brunner wrote: 2010/5/20 Anthony Liguori anth...@codemonkey.ws: With new approaches like Sheepdog or Ceph, things are getting a lot cheaper and you can scale your system without disrupting your service. The concepts are quite similar to what

Re: [Qemu-devel] [RFC PATCH 1/1] ceph/rbd block driver for qemu-kvm

2010-05-21 Thread MORITA Kazutaka
At Fri, 21 May 2010 06:28:42 +0100, Stefan Hajnoczi wrote: On Thu, May 20, 2010 at 11:16 PM, Christian Brunner c...@muc.de wrote: 2010/5/20 Anthony Liguori anth...@codemonkey.ws: Both sheepdog and ceph ultimately transmit I/O over a socket to a central daemon, right?  So could we not

[Qemu-devel] Re: [PATCH] add support for protocol driver create_options

2010-05-24 Thread MORITA Kazutaka
At Fri, 21 May 2010 13:40:31 +0200, Kevin Wolf wrote: Am 20.05.2010 07:36, schrieb MORITA Kazutaka: This patch enables protocol drivers to use their create options which are not supported by the format. For example, protcol drivers can use a backing_file option with raw format

[Qemu-devel] Re: [PATCH] add support for protocol driver create_options

2010-05-24 Thread MORITA Kazutaka
At Fri, 21 May 2010 18:57:36 +0200, Kevin Wolf wrote: Am 20.05.2010 07:36, schrieb MORITA Kazutaka: + +/* + * Append an option list (list) to an option list (dest). + * + * If dest is NULL, a new copy of list is created. + * + * Returns a pointer to the first element of dest

Re: [Qemu-devel] [RFC PATCH 1/1] ceph/rbd block driver for qemu-kvm

2010-05-24 Thread MORITA Kazutaka
At Sun, 23 May 2010 15:01:59 +0300, Avi Kivity wrote: On 05/21/2010 12:29 AM, Anthony Liguori wrote: I'd be more interested in enabling people to build these types of storage systems without touching qemu. Both sheepdog and ceph ultimately transmit I/O over a socket to a central

Re: [Qemu-devel] [RFC PATCH 1/1] ceph/rbd block driver for qemu-kvm

2010-05-24 Thread MORITA Kazutaka
At Mon, 24 May 2010 14:05:58 +0300, Avi Kivity wrote: On 05/24/2010 10:12 AM, MORITA Kazutaka wrote: At Sun, 23 May 2010 15:01:59 +0300, Avi Kivity wrote: On 05/21/2010 12:29 AM, Anthony Liguori wrote: I'd be more interested in enabling people to build these types

Re: [Qemu-devel] [RFC PATCH 1/1] ceph/rbd block driver for qemu-kvm

2010-05-24 Thread MORITA Kazutaka
At Mon, 24 May 2010 14:56:29 +0300, Avi Kivity wrote: On 05/24/2010 02:42 PM, MORITA Kazutaka wrote: The server would be local and talk over a unix domain socket, perhaps anonymous. nbd has other issues though, such as requiring a copy and no support for metadata operations

Re: [Qemu-devel] [RFC PATCH 1/1] ceph/rbd block driver for qemu-kvm

2010-05-25 Thread MORITA Kazutaka
At Mon, 24 May 2010 14:16:32 -0500, Anthony Liguori wrote: On 05/24/2010 06:56 AM, Avi Kivity wrote: On 05/24/2010 02:42 PM, MORITA Kazutaka wrote: The server would be local and talk over a unix domain socket, perhaps anonymous. nbd has other issues though, such as requiring a copy

[Qemu-devel] Re: [PATCH] add support for protocol driver create_options

2010-05-25 Thread MORITA Kazutaka
At Tue, 25 May 2010 15:43:17 +0200, Kevin Wolf wrote: Am 24.05.2010 08:34, schrieb MORITA Kazutaka: At Fri, 21 May 2010 18:57:36 +0200, Kevin Wolf wrote: Am 20.05.2010 07:36, schrieb MORITA Kazutaka: + +/* + * Append an option list (list) to an option list (dest

Re: [Qemu-devel] [RFC PATCH 1/1] ceph/rbd block driver for qemu-kvm

2010-05-25 Thread MORITA Kazutaka
At Tue, 25 May 2010 10:12:53 -0700 (PDT), Sage Weil wrote: On Tue, 25 May 2010, Avi Kivity wrote: What's the reason for not having these drivers upstream? Do we gain anything by hiding them from our users and requiring them to install the drivers separately from somewhere else?

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

2010-05-27 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 v4 1/3] close all the block drivers before the qemu process exits

2010-05-27 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 v4 3/3] block: add sheepdog driver for distributed storage support

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

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

2010-06-03 Thread MORITA Kazutaka
At Wed, 02 Jun 2010 12:49:02 +0200, Kevin Wolf wrote: Am 28.05.2010 04:44, schrieb MORITA Kazutaka: Hi all, This patch adds a block driver for Sheepdog distributed storage system. Please consider for inclusion. Hint for next time: You should remove the RFC from the subject line

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

2010-06-03 Thread MORITA Kazutaka
At Tue, 01 Jun 2010 09:58:04 -0500, Thanks for your comments! Chris Krumme wrote: On 05/27/2010 09:44 PM, MORITA Kazutaka wrote: Sheepdog is a distributed storage system for QEMU. It provides highly + +static int connect_to_sdog(const char *addr) +{ + char buf[64]; + char hbuf

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

2010-06-03 Thread MORITA Kazutaka
At Wed, 02 Jun 2010 15:55:42 +0200, Kevin Wolf wrote: Am 28.05.2010 04:44, schrieb MORITA Kazutaka: Sheepdog is a distributed storage system for QEMU. It provides highly available block level storage volumes to VMs like Amazon EBS. This patch adds a qemu block driver for Sheepdog

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

2010-06-06 Thread MORITA Kazutaka
At Fri, 04 Jun 2010 13:04:00 +0200, Kevin Wolf wrote: Am 03.06.2010 18:23, schrieb MORITA Kazutaka: +static void sd_aio_cancel(BlockDriverAIOCB *blockacb) +{ + SheepdogAIOCB *acb = (SheepdogAIOCB *)blockacb; + + acb-canceled = 1; +} Does this provide the right semantics? You

[Qemu-devel] [PATCH v5] block: add sheepdog driver for distributed storage support

2010-06-07 Thread MORITA Kazutaka
/sheepdog/ Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- Changes from v4 to v5 are: - address the comments to the sheepdog driver (Thanks Kevin, Chris!) -- fix a coding style -- fix aio_cancel handling -- fix an overflow bug in coping hostname -- add comments to the non

Re: [Qemu-devel] [PATCH v4] savevm: Really verify if a drive supports snapshots

2010-06-07 Thread MORITA Kazutaka
At Fri, 4 Jun 2010 16:35:59 -0300, Miguel Di Ciurcio Filho wrote: Both bdrv_can_snapshot() and bdrv_has_snapshot() does not work as advertized. First issue: Their names implies different porpouses, but they do the same thing and have exactly the same code. Maybe copied and pasted and

[Qemu-devel] Re: [PATCH v5] block: add sheepdog driver for distributed storage support

2010-06-15 Thread MORITA Kazutaka
At Tue, 15 Jun 2010 10:24:14 +0200, Kevin Wolf wrote: Am 14.06.2010 21:48, schrieb MORITA Kazutaka: 3) qemu-io aio_read/write doesn't seem to work well with it. I only get the result of the AIO request when I exit qemu-io. This may be a qemu-io problem or a Sheepdog one. We need to look

[Qemu-devel] [PATCH 1/2] qemu-io: retry fgets() when errno is EINTR

2010-06-15 Thread MORITA Kazutaka
posix-aio-compat sends a signal in aio operations, so we should consider that fgets() could be interrupted here. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- cmd.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/cmd.c b/cmd.c index 2336334..460df92

[Qemu-devel] [PATCH 2/2] qemu-io: check registered fds in command_loop()

2010-06-15 Thread MORITA Kazutaka
() in command_loop(). Any other handlers can be invoked when user input is idle. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- cmd.c | 53 +++-- 1 files changed, 39 insertions(+), 14 deletions(-) diff --git a/cmd.c b/cmd.c index

[Qemu-devel] [PATCH 0/2] qemu-io: fix aio_read/write problems

2010-06-15 Thread MORITA Kazutaka
handler to get I/O completion. Thanks, Kazutaka MORITA Kazutaka (2): qemu-io: retry fgets() when errno is EINTR qemu-io: check registered fds in command_loop() cmd.c | 56 ++-- 1 files changed, 42 insertions(+), 14 deletions(-)

Re: [Qemu-devel] Re: [PATCH 1/2] qemu-io: retry fgets() when errno is EINTR

2010-06-16 Thread MORITA Kazutaka
At Wed, 16 Jun 2010 13:04:47 +0200, Kevin Wolf wrote: Am 15.06.2010 19:53, schrieb MORITA Kazutaka: posix-aio-compat sends a signal in aio operations, so we should consider that fgets() could be interrupted here. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp

Re: [Qemu-devel] Re: [PATCH 1/2] qemu-io: retry fgets() when errno is EINTRg

2010-06-17 Thread MORITA Kazutaka
At Thu, 17 Jun 2010 18:18:18 +0100, Jamie Lokier wrote: Kevin Wolf wrote: Am 16.06.2010 18:52, schrieb MORITA Kazutaka: At Wed, 16 Jun 2010 13:04:47 +0200, Kevin Wolf wrote: Am 15.06.2010 19:53, schrieb MORITA Kazutaka: posix-aio-compat sends a signal in aio operations, so we

[Qemu-devel] [PATCH v2] qemu-io: check registered fds in command_loop()

2010-06-20 Thread MORITA Kazutaka
, and calls qemu_aio_wait() in command_loop(). Any other handlers can be invoked when user input is idle. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- It seems that the QEMU aio implementation doesn't allow to call qemu_aio_wait() in the aio handler, so the previous patch is broken

[Qemu-devel] [PATCH] qemu-img: avoid calling exit(1) to release resources properly

2010-06-20 Thread MORITA Kazutaka
in the close handler. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- qemu-img.c | 235 +++- 1 files changed, 184 insertions(+), 51 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index ea091f0..fe8a577 100644 --- a/qemu

[Qemu-devel] [PATCH v6] block: add sheepdog driver for distributed storage support

2010-06-20 Thread MORITA Kazutaka
/sheepdog/ Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- I've addressed the comments and tested with qemu-iotests which is hacked for Sheepdog. This version changes an inode data format to support a snapshot tag name, so to test this patch, please pull the latest sheepdog server

Re: [Qemu-devel] [PATCH 1/2] qemu-img check: Distinguish different kinds of errors

2010-07-06 Thread MORITA Kazutaka
At Fri, 2 Jul 2010 19:14:59 +0200, Kevin Wolf wrote: People think that their images are corrupted when in fact there are just some leaked clusters. Differentiating several error cases should make the messages more comprehensible. Signed-off-by: Kevin Wolf kw...@redhat.com --- block.c

[Qemu-devel] [PATCH] sheepdog: fix compile error on systems without TCP_CORK

2010-07-07 Thread MORITA Kazutaka
WIN32 is not only the system which doesn't have TCP_CORK (e.g. OS X). Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- Betts, I think this patch fix the compile error. Can you try this one? block/sheepdog.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff

[Qemu-devel] [ANNOUNCE] Sheepdog: Distributed Storage System for KVM

2009-10-20 Thread MORITA Kazutaka
sheepdog Charlie's Disk Thanks. -- MORITA, Kazutaka NTT Cyber Space Labs OSS Computing Project Kernel Group E-mail: morita.kazut...@lab.ntt.co.jp

[Qemu-devel] Re: [ANNOUNCE] Sheepdog: Distributed Storage System for KVM

2009-10-23 Thread MORITA Kazutaka
]: Leaving directory `/home/shiny/Packages/sheepdog-2009102101/sheep' make: *** [all] Error 2 I have all the required libs installed. Patching and compiling qemu-kvm went flawless. - Original Message - From: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp To: k...@vger.kernel.org

[Qemu-devel] Re: [ANNOUNCE] Sheepdog: Distributed Storage System for KVM

2009-10-23 Thread MORITA Kazutaka
? -Original Message- From: kvm-ow...@vger.kernel.org [mailto:kvm-ow...@vger.kernel.org] On Behalf Of MORITA Kazutaka Sent: Mittwoch, 21. Oktober 2009 07:14 To: k...@vger.kernel.org; qemu-devel@nongnu.org; linux- fsde...@vger.kernel.org Subject: [ANNOUNCE] Sheepdog: Distributed Storage

Re: [Qemu-devel] Re: [ANNOUNCE] Sheepdog: Distributed Storage System for KVM

2009-10-23 Thread MORITA Kazutaka
On Fri, Oct 23, 2009 at 8:10 PM, Alexander Graf ag...@suse.de wrote: On 23.10.2009, at 12:41, MORITA Kazutaka wrote: On Fri, Oct 23, 2009 at 12:30 AM, Avi Kivity a...@redhat.com wrote: How is load balancing implemented?  Can you move an image transparently while a guest is running

Re: [Qemu-devel] [ANNOUNCE] Sheepdog: Distributed Storage System for KVM

2009-10-23 Thread MORITA Kazutaka
Hi, Thanks for many comments. Sheepdog git trees are created. Sheepdog server git://sheepdog.git.sourceforge.net/gitroot/sheepdog/sheepdog Sheepdog client git://sheepdog.git.sourceforge.net/gitroot/sheepdog/qemu-kvm Please try! On Wed, Oct 21, 2009 at 2:13 PM, MORITA Kazutaka

Re: [Qemu-devel] [ANNOUNCE] Sheepdog: Distributed Storage System for KVM

2009-10-23 Thread MORITA Kazutaka
On Sat, Oct 24, 2009 at 4:45 AM, Javier Guerra jav...@guerrag.com wrote: On Fri, Oct 23, 2009 at 2:39 PM, MORITA Kazutaka morita.kazut...@lab.ntt.co.jp wrote: Thanks for many comments. Sheepdog git trees are created. great! is there any client (no matter how crude) besides the patched

[Qemu-devel] Re: [ANNOUNCE] Sheepdog: Distributed Storage System for KVM

2009-10-26 Thread MORITA Kazutaka
, because Sheepdog locks a VM image when it is opened. To avoid this problem, locking must be delayed until migration has done. This is also a TODO item. -- MORITA Kazutaka

[Qemu-devel] Re: [ANNOUNCE] Sheepdog: Distributed Storage System for KVM

2009-10-27 Thread MORITA Kazutaka
On 2009/10/21 14:13, MORITA Kazutaka wrote: Hi everyone, Sheepdog is a distributed storage system for KVM/QEMU. It provides highly available block level storage volumes to VMs like Amazon EBS. Sheepdog supports advanced volume management features such as snapshot, cloning, and thin provisioning

Re: [Qemu-devel] [PATCH] get rid of private bitmap functions in block/sheepdog.c, use generic ones

2011-03-14 Thread MORITA Kazutaka
/ BITS_PER_LONG] (nr (BITS_PER_LONG-1)));  } The body is equivalent, but the argument is not: there's volatile in there.  Why it is used for - I'm not sure. Signed-off-by: Michael Tokarev m...@tls.msk.ru Looks good. Thanks! Acked-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp

[Qemu-devel] [PATCH 0/3] sheepdog: fix aio related issues

2011-03-29 Thread MORITA Kazutaka
This patchset fixes the Sheepodg AIO problems pointed out in: http://lists.gnu.org/archive/html/qemu-devel/2011-02/msg02495.html http://lists.gnu.org/archive/html/qemu-devel/2011-02/msg02474.html Thanks, Kazutaka MORITA Kazutaka (3): sheepdog: make send/recv operations non-blocking

[Qemu-devel] [PATCH 3/3] sheepdog: avoid accessing a buffer of the canceled I/O request

2011-03-29 Thread MORITA Kazutaka
We cannot access the buffer of the canceled I/O request because its AIOCB callback is already called and the buffer is not valid. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 12 ++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git

[Qemu-devel] [PATCH 2/3] sheepdog: allow cancellation of I/Os which are not processed yet

2011-03-29 Thread MORITA Kazutaka
We can cancel I/O requests safely if they are not sent to the servers. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 37 + 1 files changed, 37 insertions(+), 0 deletions(-) diff --git a/block/sheepdog.c b/block

[Qemu-devel] [PATCH 1/3] sheepdog: make send/recv operations non-blocking

2011-03-29 Thread MORITA Kazutaka
This patch avoids retrying send/recv in AIO path when the sheepdog connection is not ready for the operation. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 417 +- 1 files changed, 289 insertions(+), 128

Re: [Qemu-devel] coroutine bug?, was Re: [PATCH] sheepdog: use coroutines

2012-01-06 Thread MORITA Kazutaka
At Tue, 3 Jan 2012 08:13:51 +, Stefan Hajnoczi wrote: On Mon, Jan 02, 2012 at 10:38:11PM +, Stefan Hajnoczi wrote: On Mon, Jan 2, 2012 at 3:39 PM, Christoph Hellwig h...@lst.de wrote: On Fri, Dec 30, 2011 at 10:35:01AM +, Stefan Hajnoczi wrote: If you can reproduce this bug

[Qemu-devel] [PATCH] sheepdog: add data preallocation support

2011-05-21 Thread MORITA Kazutaka
/sheepdog/wiki/General%20Protocol%20Support The option is disabled by default and you need to enable it like the following: qemu-img create sheepdog:test -o preallocation=data 1G Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp Signed-off-by: FUJITA Tomonori fujita.tomon...@lab.ntt.co.jp

Re: [Qemu-devel] [PATCH] sheepdog: add data preallocation support

2011-05-23 Thread MORITA Kazutaka
At Mon, 23 May 2011 10:19:13 +0100, Stefan Hajnoczi wrote: On Sat, May 21, 2011 at 1:35 PM, MORITA Kazutaka morita.kazut...@lab.ntt.co.jp wrote: +static int sd_prealloc(uint32_t vid, int64_t vdi_size) +{ +    int fd, ret; +    SheepdogInode *inode; +    char *buf; +    unsigned

Re: [Qemu-devel] [PATCH] sheepdog: add data preallocation support

2011-07-05 Thread MORITA Kazutaka
At Fri, 01 Jul 2011 10:29:09 +0200, Kevin Wolf wrote: Am 21.05.2011 14:35, schrieb MORITA Kazutaka: This introduces a qemu-img create option for sheepdog which allows the data to be preallocated (note that sheepdog always preallocates metadata). This is necessary to use Sheepdog volumes

[Qemu-devel] [PATCH v2] sheepdog: add full data preallocation support

2011-07-05 Thread MORITA Kazutaka
-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp Signed-off-by: FUJITA Tomonori fujita.tomon...@lab.ntt.co.jp --- block/sheepdog.c | 71 +++-- 1 files changed, 68 insertions(+), 3 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c

Re: [Qemu-devel] [Sheepdog] [PATCH] sheepdog: add data preallocation support

2011-07-08 Thread MORITA Kazutaka
At Wed, 06 Jul 2011 09:53:32 +0200, Kevin Wolf wrote: Am 05.07.2011 20:21, schrieb MORITA Kazutaka: + +max_idx = (vdi_size + SD_DATA_OBJ_SIZE - 1) / SD_DATA_OBJ_SIZE; + +for (idx = 0; idx max_idx; idx++) { +uint64_t oid; +oid = vid_to_data_oid(vid, idx

[Qemu-devel] [PATCH] sheepdog: use coroutines

2011-08-12 Thread MORITA Kazutaka
for the operation. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 150 + 1 files changed, 93 insertions(+), 57 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index e150ac0..e283c34 100644 --- a/block

Re: [Qemu-devel] [PATCH] sheepdog: use coroutines

2011-08-23 Thread MORITA Kazutaka
At Tue, 23 Aug 2011 14:29:50 +0200, Kevin Wolf wrote: Am 12.08.2011 14:33, schrieb MORITA Kazutaka: This makes the sheepdog block driver support bdrv_co_readv/writev instead of bdrv_aio_readv/writev. With this patch, Sheepdog network I/O becomes fully asynchronous. The block driver

Re: [Qemu-devel] [PATCH 09/12] sheepdog: move coroutine send/recv function to generic code

2011-09-08 Thread MORITA Kazutaka
of bytes written before encountering an EAGAIN. The specificity of yielding on EAGAIN is entirely in qemu-coroutine.c. Cc: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block/sheepdog.c | 221

Re: [Qemu-devel] [PATCH v2 09/12] sheepdog: move coroutine send/recv function to generic code

2011-09-12 Thread MORITA Kazutaka
of bytes written before encountering an EAGAIN. The specificity of yielding on EAGAIN is entirely in qemu-coroutine.c. Cc: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- Thanks for the review. I checked with qemu-io that all

Re: [Qemu-devel] [PATCH v2 01/15] sheepdog: add coroutine_fn markers

2011-09-16 Thread MORITA Kazutaka
At Fri, 16 Sep 2011 16:25:38 +0200, Paolo Bonzini wrote: This makes the following patch easier to review. Cc: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block/sheepdog.c | 14 +++--- 1 files changed, 7 insertions(+), 7

Re: [Qemu-devel] [PATCH v2 02/15] add socket_set_block

2011-09-16 Thread MORITA Kazutaka
At Fri, 16 Sep 2011 16:25:39 +0200, Paolo Bonzini wrote: Cc: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- oslib-posix.c |7 +++ oslib-win32.c |6 ++ qemu_socket.h |1 + 3 files changed, 14 insertions(+), 0

Re: [Qemu-devel] [PATCH v2 03/15] sheepdog: move coroutine send/recv function to generic code

2011-09-17 Thread MORITA Kazutaka
of bytes written before encountering an EAGAIN. The specificity of yielding on EAGAIN is entirely in qemu-coroutine.c. Reviewed-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- block/sheepdog.c | 225

Re: [Qemu-devel] [PATCH v2 04/15] coroutine-io: handle zero returns from recv

2011-09-17 Thread MORITA Kazutaka
At Fri, 16 Sep 2011 16:25:41 +0200, Paolo Bonzini wrote: When the other side is shutdown, read returns zero (writes return EPIPE). In this case, care must be taken to avoid infinite loops. This error was already present in sheepdog. Cc: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp

Re: [Qemu-devel] [PATCH v2 03/15] sheepdog: move coroutine send/recv function to generic code

2011-09-17 Thread MORITA Kazutaka
At Sat, 17 Sep 2011 16:49:22 +0200, Paolo Bonzini wrote: On 09/17/2011 08:29 AM, MORITA Kazutaka wrote: +#else +struct iovec *p = iov; +ret = 0; +while (iovlen 0) { +int rc; +if (do_sendv) { +rc = send

[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 morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 22 -- 1 files changed

[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 morita.kazut...@lab.ntt.co.jp --- 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

[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 sending all

[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 morita.kazut...@lab.ntt.co.jp --- 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

[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 morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 29 - 1 files changed, 16 insertions(+), 13 deletions

[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 morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 49 - 1 files changed, 24 insertions(+), 25

[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 morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 14 ++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index afd06aa..0b49c6d

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 h...@lst.de Index: qemu/block/sheepdog.c === ---

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)) { -/* Copy-On-Write

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 morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 10 -- 1 files changed, 8

[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 morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 113 ++--- 1 files changed, 47 insertions(+), 66 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index 6e73efb

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 h...@lst.de --- block/sheepdog.c | 28 ++-- 1 file changed, 18 insertions(+), 10 deletions(-) Index:

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

2012-07-09 Thread MORITA Kazutaka
(-) Acked-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp

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

2012-07-10 Thread MORITA Kazutaka
(-) Acked-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp

[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 morita.kazut...@lab.ntt.co.jp --- 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

Re: [Qemu-devel] [PATCH v3] sheepdog: implement SD_OP_FLUSH_VDI operation

2012-04-03 Thread MORITA Kazutaka
At Tue, 3 Apr 2012 16:35:00 +0800, Liu Yuan wrote: +static int coroutine_fn sd_co_flush_to_disk(BlockDriverState *bs) +{ +BDRVSheepdogState *s = bs-opaque; +SheepdogObjReq hdr = { 0 }; +SheepdogObjRsp *rsp = (SheepdogObjRsp *)hdr; +SheepdogInode *inode = s-inode; +

Re: [Qemu-devel] [PATCH v4 UPDATE] sheepdog: implement SD_OP_FLUSH_VDI operation

2012-04-03 Thread MORITA Kazutaka
...@redhat.com Cc: Michael Tokarev m...@tls.msk.ru Cc: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp Cc: Stefan Hajnoczi stefa...@gmail.com Signed-off-by: Liu Yuan tailai...@taobao.com --- UPDATE: use flush_fd instead of s-fd. block/sheepdog.c | 142

Re: [Qemu-devel] RE. [PATCH] sheepdog: fix send req helpers

2012-04-03 Thread MORITA Kazutaka
...@redhat.com Cc: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp Signed-off-by: Liu Yuan tailai...@taobao.com --- block/sheepdog.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) Acked-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp

Re: [Qemu-devel] [PATCH 02/22] sheepdog: avoid a few buffer overruns

2012-05-09 Thread MORITA Kazutaka
must be NUL-terminated. Signed-off-by: Jim Meyering meyer...@redhat.com Acked-by: Kevin Wolf kw...@redhat.com Kazutaka, can you have a look? I think you may want to send patches on top to improve the places where Jim just put a comment. Acked-by: MORITA Kazutaka morita.kazut

[Qemu-devel] [PATCH 1.1 1/4] sheepdog: mark image as snapshot when tag is specified

2012-05-16 Thread MORITA Kazutaka
When a snapshot tag is specified in the filename, the opened image is a snapshot. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index e01d371..776a1cc

[Qemu-devel] [PATCH 1.1 2/4] sheepdog: fix return value of do_load_save_vm_state

2012-05-16 Thread MORITA Kazutaka
bdrv_save_vmstate and bdrv_load_vmstate should return the number of processed bytes on success. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c |8 ++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c

[Qemu-devel] [PATCH 1.1 3/4] sheepdog: return -errno on error

2012-05-16 Thread MORITA Kazutaka
On error, BlockDriver APIs should return -errno instead of -1. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 78 +++-- 1 files changed, 46 insertions(+), 32 deletions(-) diff --git a/block/sheepdog.c b/block

[Qemu-devel] [PATCH 1.1 4/4] sheepdog: use heap instead of stack for BDRVSheepdogState

2012-05-16 Thread MORITA Kazutaka
bdrv_create() is called in coroutine context now, so we cannot use more stack than 1 MB in the function if we use ucontext coroutine. This patch allocates BDRVSheepdogState, whose size is 4 MB, on the heap in sd_create(). Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block

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

2012-05-16 Thread MORITA Kazutaka
This patchset contains various fixes for Sheepdog. See individual patches for details. MORITA Kazutaka (4): sheepdog: mark image as snapshot when tag is specified sheepdog: fix return value of do_load_save_vm_state sheepdog: return -errno on error sheepdog: use heap instead of stack

[Qemu-devel] [PATCH 1.1 v2] sheepdog: fix return value of do_load_save_vm_state

2012-05-29 Thread MORITA Kazutaka
bdrv_save_vmstate and bdrv_load_vmstate should return the vmstate size on success, and -errno on error. Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- Changes from v1 - return an error for short reads/writes - fix a coding style problem block/sheepdog.c | 10 +- 1

[Qemu-devel] [PATCH 1.1] sheepdog: add coroutine_fn markers to coroutine functions

2012-05-29 Thread MORITA Kazutaka
Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c |9 + 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index f46ca8f..046f52a 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -522,8 +522,8

Re: [Qemu-devel] [PATCH 1.1] sheepdog: add coroutine_fn markers to coroutine functions

2012-05-29 Thread MORITA Kazutaka
At Tue, 29 May 2012 18:30:17 +0200, Andreas Färber wrote: Am 29.05.2012 18:22, schrieb MORITA Kazutaka: Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp Patch is tab-damaged. Oops, I'll send a new version. Thanks, Kazutaka Andreas --- block/sheepdog.c |9

[Qemu-devel] [PATCH 1.1 v2] sheepdog: add coroutine_fn markers to coroutine functions

2012-05-29 Thread MORITA Kazutaka
Signed-off-by: MORITA Kazutaka morita.kazut...@lab.ntt.co.jp --- Changes from v1: - use spaces for indentation block/sheepdog.c |9 + 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/block/sheepdog.c b/block/sheepdog.c index f46ca8f..8877f45 100644 --- a/block

Re: [Qemu-devel] [PATCH] sheepdog: implement SD_OP_FLUSH_VDI operation

2012-04-20 Thread MORITA Kazutaka
At Fri, 20 Apr 2012 20:05:48 +0200, Christoph Hellwig wrote: On Tue, Apr 03, 2012 at 01:35:50AM +0800, Liu Yuan wrote: From: Liu Yuan tailai...@taobao.com Flush operation is supposed to flush the write-back cache of sheepdog cluster. By issuing flush operation, we can assure the

Re: [Qemu-devel] [PATCH] sheepdog: implement SD_OP_FLUSH_VDI operation

2012-04-23 Thread MORITA Kazutaka
At Mon, 23 Apr 2012 08:08:46 +0200, Christoph Hellwig wrote: On Fri, Apr 20, 2012 at 12:15:36PM -0700, MORITA Kazutaka wrote: His patch sets the SD_FLAG_CMD_CACHE flag for writes only when the user selects cache=writeback or cache=none. If SD_FLAG_CMD_CACHE is not set in the request

[Qemu-devel] [PATCH] sheepdog: switch to writethrough mode if cluster doesn't support flush

2012-05-02 Thread MORITA Kazutaka
This is necessary for qemu to work with the older version of Sheepdog which doesn't support SD_OP_FLUSH_VDI. Signed-off-by: MORITA Kazutaka morita.kazut...@gmail.com --- block/sheepdog.c |8 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/block/sheepdog.c b/block

[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 morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/block/sheepdog.c b/block

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

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

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

[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 morita.kazut...@lab.ntt.co.jp --- block/sheepdog.c | 139 +-- qemu-doc.texi

[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 morita.kazut...@lab.ntt.co.jp --- 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

[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 morita.kazut...@lab.ntt.co.jp --- slirp/tcp_subr.c | 140 --- 1 file changed, 72 insertions(+), 68 deletions(-) diff --git a/slirp/tcp_subr.c b/slirp

<    1   2   3   >