From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:48721) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3TPe-0005F6-6S for qemu-devel@nongnu.org; Tue, 13 Sep 2011 09:52:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1R3TPZ-0004Y7-H3 for qemu-devel@nongnu.org; Tue, 13 Sep 2011 09:52:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31818) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1R3TPZ-0004Xx-A5 for qemu-devel@nongnu.org; Tue, 13 Sep 2011 09:52:29 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p8DDqSR3002358 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 13 Sep 2011 09:52:28 -0400 Message-ID: <4E6F60CE.2010901@redhat.com> Date: Tue, 13 Sep 2011 15:55:26 +0200 From: Kevin Wolf MIME-Version: 1.0 References: <1315495505-28906-1-git-send-email-pbonzini@redhat.com> <1315495505-28906-6-git-send-email-pbonzini@redhat.com> In-Reply-To: <1315495505-28906-6-git-send-email-pbonzini@redhat.com> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 05/12] nbd: add support for NBD_CMD_FLAG_FUA List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org Am 08.09.2011 17:24, schrieb Paolo Bonzini: > The server can use it to issue a flush automatically after a > write. The client can also use it to mimic a write-through > cache. > > Signed-off-by: Paolo Bonzini > --- > block/nbd.c | 8 ++++++++ > nbd.c | 13 +++++++++++-- > 2 files changed, 19 insertions(+), 2 deletions(-) > @@ -674,6 +675,14 @@ int nbd_trip(BlockDriverState *bs, int csock, off_t size, uint64_t dev_offset, > } > > *offset += request.len; > + > + if (request.type & NBD_CMD_FLAG_FUA) { > + if (bdrv_flush(bs) == -1) { Need to check for < 0 here as well. Kevin