From: Stefano Stabellini Subject: Re: [PATCH 1/3] qemu-xen-traditional: use O_DIRECT to open disk images for IDE [and 1 more messages] Date: Fri, 30 Mar 2012 15:47:30 +0100 Message-ID: References: <1332514289-28129-1-git-send-email-stefano.stabellini@eu.citrix.com> <20337.63345.79209.977387@mariner.uk.xensource.com> <1332925851.7702.9.camel@zakaz.uk.xensource.com> <20340.28608.642720.913130@mariner.uk.xensource.com> <20340.41716.915705.558140@mariner.uk.xensource.com> <20341.47286.110264.864514@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20341.47286.110264.864514@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: "Zhang, Yang Z" , "xen-devel@lists.xensource.com" , Ian Campbell , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Fri, 30 Mar 2012, Ian Jackson wrote: > Stefano Stabellini writes ("Re: [Xen-devel] [PATCH 1/3] qemu-xen-traditional: use O_DIRECT to open disk images for IDE [and 1 more messages]"): > > In qemu-xen you can easily have this sequence of calls: > > > > bdrv_co_writev -> qcow2_co_writev -> qcow2_alloc_cluster_offset -> > > get_cluster_table -> qcow2_grow_l1_table -> bdrv_pwrite_sync > ... > > In qemu-xen-traditional they would become: > > > > qcow_aio_write_cb -> alloc_cluster_offset -> get_cluster_table -> > > grow_l1_table -> bdrv_pwrite > > > > > > The key piece of information is that bdrv_pwrite_sync issues a > > bdrv_flush if the file was opened as WB, while bdrv_pwrite does not. > > Yes, but why does this matter ? If the guest cares about the data > then it will either turn off caching entirely, or issue an explicit > flush operation, which will translate into a bdrv_flush. So the flush > will happen. If the QCOW2 metadata is written/updated in response to events other than bdrv_write, they could still get out of sync. However giving a look at block-qcow2.c I wasn't able to find any such cases (aside snapshots that we don't support), so it should be OK to use WB with IDE and QCOW2 on qemu-xen-traditional too.