From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34980) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsVfb-0004PD-1F for qemu-devel@nongnu.org; Tue, 08 Jan 2013 04:40:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TsVfZ-0006vg-TP for qemu-devel@nongnu.org; Tue, 08 Jan 2013 04:40:30 -0500 Received: from mail-bk0-f52.google.com ([209.85.214.52]:33810) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TsVfZ-0006vc-MG for qemu-devel@nongnu.org; Tue, 08 Jan 2013 04:40:29 -0500 Received: by mail-bk0-f52.google.com with SMTP id w5so101311bku.39 for ; Tue, 08 Jan 2013 01:40:28 -0800 (PST) Date: Tue, 8 Jan 2013 10:40:25 +0100 From: Stefan Hajnoczi Message-ID: <20130108094025.GE2557@stefanha-thinkpad.redhat.com> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <50EBB1CB.9030608@gmail.com> Subject: Re: [Qemu-devel] [PATCH] sheepdog: implement direct write semantics List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Liu Yuan Cc: Kevin Wolf , Paolo Bonzini , qemu-devel@nongnu.org, MORITA Kazutaka On Tue, Jan 08, 2013 at 01:42:35PM +0800, Liu Yuan wrote: > On 01/07/2013 09:23 PM, Kevin Wolf wrote: > > No, and in theory they shouldn't have to care. > > > > Why do you want to handle writethrough semantics in the block driver > > rather than letting qemu care for sending the right flushes? > > Because Sheepdog itself provide the client side cache implementation and > we need means to get the cache hint from users when starting up the VM. > This cache support: > writethrough: provide a read cache for this VM, which is always > consistent with cluster data > writeback: provide a writeback cache for this VM, which only flush the > dirty bits when VM send 'flush' request. > directio: disable cache completely for this VM. > > Old QEMU (before v1.2) allows block drivers to get the cache flags, so > Sheepdog can interpret these flags on its own to choose the right cache > mode for each VM. doesn't QEMU need keep backward compatibility? This sounds fine - it fits together with QEMU like this: BDRV_NO_CACHE means sheepdog directio. We're disabling the client-side sheepdog cache. Otherwise use sheepdog writeback and let QEMU block.c decide when to flush. Never use sheepdog writethrough because it's redundant here. Stefan