From patchwork Tue Aug 7 13:44:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benoit Canet X-Patchwork-Id: 175633 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 029C92C0090 for ; Tue, 7 Aug 2012 23:45:14 +1000 (EST) Received: from localhost ([::1]:39908 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Syk5w-0005jK-0P for incoming@patchwork.ozlabs.org; Tue, 07 Aug 2012 09:45:12 -0400 Received: from eggs.gnu.org ([208.118.235.92]:38418) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Syk5Y-0005Ni-4P for qemu-devel@nongnu.org; Tue, 07 Aug 2012 09:44:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Syk5W-0007wj-Sl for qemu-devel@nongnu.org; Tue, 07 Aug 2012 09:44:47 -0400 Received: from mail-wg0-f53.google.com ([74.125.82.53]:57580) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Syk5W-0007wY-Mx for qemu-devel@nongnu.org; Tue, 07 Aug 2012 09:44:46 -0400 Received: by wgbfm10 with SMTP id fm10so2972325wgb.10 for ; Tue, 07 Aug 2012 06:44:45 -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=JQL4qhPuFVGyvzMEYrEw/+TF7Nwj15+8cPXQLOJmz4M=; b=r8aU7/jOB/P+YZGbBkGxrbQWr4aW0BUTLUBe7JxAEwvglZ4JdVDn3FDaTN/FNwoXdp vP6MK3HK35j1aNuZwvXoyR/+PpTfdtzO/aPZaV4Yx6qksYOo9wudMxpXjsGwMw/11Inl ObHozgtGxTI5WFR8LGbOkjrD2/ciWp+vxGZ0+9n7nePQfSq95jI3d5qKCNyy7G7qSS05 9HeCCalJf3qQP79jQCQPpTAfCQjy5/cRiZfMYIL46p+5pK/0WRZRYjYPJU9pfIVyYjuo 8B1sPOYe1YmDN3mCzpRtXFMIOiXiUxH3oL9/4TpYdKNM40l5ftNTVy73pymjedR7OeqA vNLw== Received: by 10.180.78.5 with SMTP id x5mr27735595wiw.13.1344347085887; Tue, 07 Aug 2012 06:44:45 -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.44 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 07 Aug 2012 06:44:45 -0700 (PDT) From: "=?UTF-8?q?Beno=C3=AEt=20Canet?=" To: qemu-devel@nongnu.org Date: Tue, 7 Aug 2012 15:44:27 +0200 Message-Id: <1344347073-7773-5-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: 74.125.82.53 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 04/10] quorum: Add quorum_close(). 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 | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/block/quorum.c b/block/quorum.c index de58ab8..9da0432 100644 --- a/block/quorum.c +++ b/block/quorum.c @@ -107,6 +107,17 @@ clean_exit: return ret; } +static void quorum_close(BlockDriverState *bs) +{ + BDRVQuorumState *s = bs->opaque; + int i; + + /* Ensure writes reach stable storage */ + for (i = 0; i <= 2; i++) { + bdrv_flush(s->bs[i]); + } +} + static BlockDriver bdrv_quorum = { .format_name = "quorum", .protocol_name = "quorum", @@ -114,6 +125,7 @@ static BlockDriver bdrv_quorum = { .instance_size = sizeof(BDRVQuorumState), .bdrv_file_open = quorum_open, + .bdrv_close = quorum_close, }; static void bdrv_quorum_init(void)