From patchwork Tue Aug 7 13:44:31 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benoit Canet X-Patchwork-Id: 175642 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 46C1C2C0084 for ; Wed, 8 Aug 2012 00:05:19 +1000 (EST) Received: from localhost ([::1]:42749 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Syk6G-0007Ip-Et for incoming@patchwork.ozlabs.org; Tue, 07 Aug 2012 09:45:32 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58778) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Syk5d-0005fd-J7 for qemu-devel@nongnu.org; Tue, 07 Aug 2012 09:44:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Syk5c-0007yK-Kk for qemu-devel@nongnu.org; Tue, 07 Aug 2012 09:44:53 -0400 Received: from mail-wi0-f181.google.com ([209.85.212.181]:56866) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Syk5c-0007ur-EK for qemu-devel@nongnu.org; Tue, 07 Aug 2012 09:44:52 -0400 Received: by mail-wi0-f181.google.com with SMTP id hm2so2110594wib.10 for ; Tue, 07 Aug 2012 06:44:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=y7eDLQQUZPuK4ZBznYqKD4fHu5ZQH6YBDXHgibSM32M=; b=z1qsAMnlaTVLR5cbUAN+G+8v4DsANnQK9LZigrjd+T1XRbE7bDXxZJp6X0ZXo3sKXB c/i/lvFmPy2soumOGJraZ7tLhbxFtTlLX6uBHUeb2+0JyGtg7xUbjBAisxDSuusf6hq0 ZUuUxivvO0Gpgjv6hVOoeOY95l4xT0yfKNL3s2ZJOwphU7sE/gCGP0iofE0dCo9w0jlR TGtjUEozPZpHogKGyiekw0ZQaBoIjFg3yih4MtajetRYO3REk9kS640ARCODvNxToCTe Z/A7pRazBYuQx1LSkPN6rtRsgKAzn/zJfLfzpIdHeZboOQ05PMpWF0P0PlhwsIqUiOgn SbhQ== Received: by 10.180.78.4 with SMTP id x4mr27698994wiw.19.1344347092002; Tue, 07 Aug 2012 06:44:52 -0700 (PDT) Received: from Laure.box.in.irqsave.net (paradis.irqsave.net. [109.190.18.76]) by mx.google.com with ESMTPS id cu1sm21381569wib.6.2012.08.07.06.44.50 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 07 Aug 2012 06:44:51 -0700 (PDT) From: "=?UTF-8?q?Beno=C3=AEt=20Canet?=" To: qemu-devel@nongnu.org Date: Tue, 7 Aug 2012 15:44:31 +0200 Message-Id: <1344347073-7773-9-git-send-email-benoit@irqsave.net> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1344347073-7773-1-git-send-email-benoit@irqsave.net> References: <1344347073-7773-1-git-send-email-benoit@irqsave.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.212.181 Cc: kwolf@redhat.com, stefanha@linux.vnet.ibm.com, blauwirbel@gmail.com, anthony@codemonkey.ws, pbonzini@redhat.com, eblake@redhat.com, afaerber@suse.de, =?UTF-8?q?Beno=C3=AEt=20Canet?= Subject: [Qemu-devel] [RFC V2 08/10] quorum: Add quorum_co_flush(). X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Signed-off-by: Benoit Canet --- block/quorum.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/block/quorum.c b/block/quorum.c index 003fc3f..2df3ae6 100644 --- a/block/quorum.c +++ b/block/quorum.c @@ -245,6 +245,21 @@ static BlockDriverAIOCB *quorum_aio_writev(BlockDriverState *bs, return &acb->common; } +static coroutine_fn int quorum_co_flush(BlockDriverState *bs) +{ + BDRVQuorumState *s = bs->opaque; + int i, ret; + + for (i = 0; i <= 2; i++) { + ret = bdrv_co_flush(s->bs[i]); + if (ret < 0) { + return ret; + } + } + + return ret; +} + static BlockDriver bdrv_quorum = { .format_name = "quorum", .protocol_name = "quorum", @@ -255,6 +270,7 @@ static BlockDriver bdrv_quorum = { .bdrv_file_open = quorum_open, .bdrv_close = quorum_close, + .bdrv_co_flush_to_disk = quorum_co_flush, .bdrv_aio_writev = quorum_aio_writev, };