From: Ian Jackson 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 14:44:22 +0100 Message-ID: <20341.47286.110264.864514@mariner.uk.xensource.com> 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> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: "Zhang, Yang Z" , "xen-devel@lists.xensource.com" , Ian Campbell List-Id: xen-devel@lists.xenproject.org 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. Ian.