From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59854) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoshX-00027D-Qx for qemu-devel@nongnu.org; Thu, 13 Nov 2014 06:36:45 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XoshO-0004dE-Ql for qemu-devel@nongnu.org; Thu, 13 Nov 2014 06:36:35 -0500 Received: from mail-wg0-x233.google.com ([2a00:1450:400c:c00::233]:43202) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XoshO-0004d7-Je for qemu-devel@nongnu.org; Thu, 13 Nov 2014 06:36:26 -0500 Received: by mail-wg0-f51.google.com with SMTP id l18so16958989wgh.10 for ; Thu, 13 Nov 2014 03:36:25 -0800 (PST) Date: Thu, 13 Nov 2014 11:36:23 +0000 From: Stefan Hajnoczi Message-ID: <20141113113623.GP7462@stefanha-thinkpad.redhat.com> References: <7bbecfc7.afc2.1499801f415.Coremail.magazine.lihuiba@163.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="zxEKvxCKojqA/Afl" Content-Disposition: inline In-Reply-To: <7bbecfc7.afc2.1499801f415.Coremail.magazine.lihuiba@163.com> Subject: Re: [Qemu-devel] when to bdrv_co_flush()? List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: lihuiba Cc: "qemu-devel@nongnu.org" --zxEKvxCKojqA/Afl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 10, 2014 at 12:41:45PM +0800, lihuiba wrote: > bdrv_co_flush() will flush all cached data to persistent storage, and I'm > wondering whether guest sync() will eventually trigger bdrv_co_flush() be > called.=20 virtio-blk and other emulated storage controllers use bdrv_aio_flush() to implement disk write cache flush commands. > Intuitively, guest sync() should trigger bdrv_co_flush() in qemu. But sim= ple >=20 > grep gave me a negative answer. So I'm wondering why it's not like what I >=20 > suspected. A correctly configured guest will send cache flush commands, and a correctly configured QEMU will honor them. If want help finding the answer, please provide details: 1. Your QEMU command-line 2. Your guest OS version and file system mount options 3. Why you believe bdrv_co_flush() is not being called Stefan --zxEKvxCKojqA/Afl Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJUZJe3AAoJEJykq7OBq3PIZDQH/0q+deqo+820OGYoQYLny4Af rV1agDbw86E18FKS8SjCDtM1ogfCkqOCWMeYC0PUssZsSRi6jDbQ8Xlc96DOm+l2 OaC2fxKQI6+m+8zH8h2y3obavPQnA/Wo/9ifJzB4ph+LjR2zkZ9s8/6l3M8YbuoC sDzwOy/WwMtC4QG06lDzRk7/YP+HVx76eH2D/xB8OdfGI78xGjVusljS02FwI1h8 acXv+xZOuRUiIzGhVUjYAu0Ok/0hg06Q2mSU+87nbErDQ80u3wanvLY18yNmBy/r 738p6j9FGXCMSioJS1Oeo84orjRdyNbaJWmPO637uhUX4bZPhujrODIqytsiXlw= =EBr0 -----END PGP SIGNATURE----- --zxEKvxCKojqA/Afl--