From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Richard W.M. Jones" Subject: Re: [virt-tools-list] cache write back & barriers Date: Sun, 16 Jun 2013 13:06:13 +0100 Message-ID: <20130616120315.GA11734@redhat.com> References: <20130612080310.GI19349@belle.intranet.vanheusden.com> <20130613082619.GA2633@stefanha-thinkpad.redhat.com> <20130613084727.GL19349@belle.intranet.vanheusden.com> <20130614105304.GB26780@stefanha-thinkpad.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: folkert , kvm@vger.kernel.org, virt-tools-list@redhat.com To: Stefan Hajnoczi Return-path: Received: from mx1.redhat.com ([209.132.183.28]:56843 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754972Ab3FPMGb (ORCPT ); Sun, 16 Jun 2013 08:06:31 -0400 Content-Disposition: inline In-Reply-To: <20130614105304.GB26780@stefanha-thinkpad.redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Jun 14, 2013 at 12:53:04PM +0200, Stefan Hajnoczi wrote: > On Thu, Jun 13, 2013 at 10:47:32AM +0200, folkert wrote: > > Hi, > > > > > > In virt-manager I saw that there's the option for cache writeback for > > > > storage devices. > > > > I'm wondering: does this also make kvm to ignore write barriers invoked > > > > by the virtual machine? Looking at current git, the cache types supported by virt-manager are: - none - writethrough - writeback - default [virt-manager only, not in virt-install] These translate directly into the libvirt field which you can find documented here: http://libvirt.org/formatdomain.html#elementsDisks As far as I can tell (from looking at libvirt sources) as long as you have a modern qemu these will translate to the same names on the qemu command line. > > > No, that would be unsafe. When the guest issues a flush then QEMU will > > > ensure that data reaches the disk with -drive cache=writeback. > > > > Aha so the writeback behaves like the consume harddisks with write-cache > > on them. In answer to the original question by 'folkert': > > In that case maybe an extra note could be added to the virt-manager > > (excellent software by the way!) that if the client vm supports > > barriers, that write-back in that case then is safe. Agree? I suspect the problem with doing this is it depends on the hypervisor. Likely for qemu and Xen (since it uses a qemu device model) this would be true. Possibly not for other hypervisors that virt-manager can control. Generally speaking, it would be nice to document these properly and also how they are implemented in different hypervisors, because I know I for one don't find these settings very obvious. So, patches welcome! Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v