From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:45677) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsuU6-000542-GX for qemu-devel@nongnu.org; Wed, 09 Jan 2013 07:10:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TsuTz-0006Y0-AP for qemu-devel@nongnu.org; Wed, 09 Jan 2013 07:10:18 -0500 Received: from mail-pa0-f47.google.com ([209.85.220.47]:47903) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsuTz-0006Wr-2z for qemu-devel@nongnu.org; Wed, 09 Jan 2013 07:10:11 -0500 Received: by mail-pa0-f47.google.com with SMTP id fa10so995305pad.34 for ; Wed, 09 Jan 2013 04:10:10 -0800 (PST) Message-ID: <50ED5E19.8020902@gmail.com> Date: Wed, 09 Jan 2013 20:10:01 +0800 From: Liu Yuan MIME-Version: 1.0 References: <1355941771-3418-1-git-send-email-namei.unix@gmail.com> <87k3s6shdv.wl%morita.kazutaka@lab.ntt.co.jp> <50D967C3.7020109@gmail.com> <50E58B19.2050701@gmail.com> <20130104163830.GF6310@stefanha-thinkpad.hitronhub.home> <50E7AEC4.5080309@gmail.com> <50E7BA41.3020307@gmail.com> <50E7DC9B.4080309@gmail.com> <50EACC61.2020603@redhat.com> <50EBB1CB.9030608@gmail.com> <20130108094025.GE2557@stefanha-thinkpad.redhat.com> <50EBEAD2.6070608@gmail.com> <50EBEE42.7010407@redhat.com> <50EBF755.3050607@gmail.com> <50EBFA3F.8030808@redhat.com> <50EBFE20.9010100@gmail.com> <50EC00CE.80205@redhat.com> <50EC0493.8030701@gmail.com> <50EC0D41.4070200@redhat.com> <50EC1C9A.5040006@gmail.com> <50ED45A8.5020706@redhat.com> <50ED4829.1070302@gmail.com> <50ED4933.3040001@redhat.com> <50ED4A90.2080808@gmail.com> <50ED5D64.4040600@gmail.com> In-Reply-To: <50ED5D64.4040600@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] sheepdog: implement direct write semantics List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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: 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); 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);