From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35640) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Urwik-0000jD-UL for qemu-devel@nongnu.org; Wed, 26 Jun 2013 16:53:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Urwii-00013t-Cb for qemu-devel@nongnu.org; Wed, 26 Jun 2013 16:53:42 -0400 Received: from mail-ea0-x22e.google.com ([2a00:1450:4013:c01::22e]:60721) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Urwii-00013h-7E for qemu-devel@nongnu.org; Wed, 26 Jun 2013 16:53:40 -0400 Received: by mail-ea0-f174.google.com with SMTP id o10so7756282eaj.33 for ; Wed, 26 Jun 2013 13:53:39 -0700 (PDT) Sender: Paolo Bonzini Message-ID: <51CB54CC.30409@redhat.com> Date: Wed, 26 Jun 2013 22:53:32 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] xen_disk: support cache backend option List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefano Stabellini Cc: xen-devel@lists.xensource.com, Ian Jackson , qemu-devel@nongnu.org Il 26/06/2013 19:48, Stefano Stabellini ha scritto: > + if (!strcmp(blkdev->cache, "none")) { > + qflags = BDRV_O_NATIVE_AIO | BDRV_O_NOCACHE; > + } else if (!strcmp(blkdev->cache, "writethrough")) { > + qflags = 0; > + } else { > + /* default to writeback */ > + qflags = BDRV_O_NATIVE_AIO | BDRV_O_CACHE_WB; > + } You can use bdrv_parse_cache_flags. Note that BDRV_O_NATIVE_AIO requires BDRV_O_NOCACHE too (but if you only specify BDRV_O_NATIVE_AIO it's a no-op, not an error). Paolo