From patchwork Wed Jan 9 12:10:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: sheepdog: implement direct write semantics Date: Wed, 09 Jan 2013 02:10:01 -0000 From: namei.unix@gmail.com X-Patchwork-Id: 210705 Message-Id: <50ED5E19.8020902@gmail.com> To: Paolo Bonzini Cc: Kevin Wolf , Stefan Hajnoczi , qemu-devel@nongnu.org, MORITA Kazutaka On 01/09/2013 08:07 PM, Liu Yuan wrote: > $ qemu-system-x86_64 --enable-kvm -drive > file=~/images/test1,if=virtio,cache=writeback -smp 2 -cpu host -m 1024 > -drive file=sheepdog:test,if=virtio,cache=writeback To emulate old impl, I modified the sheepdog block driver as following: if (s->flush_fd < 0) { @@ -1125,6 +1126,7 @@ static int sd_open(BlockDriverState *bs, const char *filename, int flags) ret = s->flush_fd; goto out; } + } if (snapid || tag[0] != '\0') { dprintf("%" PRIx32 " snapshot inode was open.\n", vid); diff --git a/block/sheepdog.c b/block/sheepdog.c index e821746..321a426 100644 --- a/block/sheepdog.c +++ b/block/sheepdog.c @@ -1118,6 +1118,7 @@ static int sd_open(BlockDriverState *bs, const char *filename, int flags) goto out; } + if (0) { s->cache_enabled = true; s->flush_fd = connect_to_sdog(s->addr, s->port);