From patchwork Mon Mar 12 10:16:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 10275907 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5D8F56055C for ; Mon, 12 Mar 2018 10:19:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62FE828C59 for ; Mon, 12 Mar 2018 10:19:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5762028CE3; Mon, 12 Mar 2018 10:19:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7C3E628C59 for ; Mon, 12 Mar 2018 10:19:08 +0000 (UTC) Received: from localhost ([::1]:57493 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evKXr-0004DW-In for patchwork-qemu-devel@patchwork.kernel.org; Mon, 12 Mar 2018 06:19:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evKWG-0002it-0B for qemu-devel@nongnu.org; Mon, 12 Mar 2018 06:17:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1evKWD-0006dL-45 for qemu-devel@nongnu.org; Mon, 12 Mar 2018 06:17:27 -0400 Received: from mail-eopbgr10121.outbound.protection.outlook.com ([40.107.1.121]:6708 helo=EUR02-HE1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1evKWC-0006Rl-Hv; Mon, 12 Mar 2018 06:17:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=nGab3CxsLOV2Bie8nXNY00Y7alG7qwQGdLvdr7kWT2s=; b=G++H1Hcs3M1DJLG7MGfrnMN3MGIP04Y+qEXRJMl2yRLhWaCFB9qIShs9CoytlwXTmPjUD0Uol1Acxh1qo0m7rsC8QpuywuA0WbEbX340LcT5Vg97u90NSRqAAzmZU4/w+ckIuYmvCMlfzwpgcbYZpjNPh7DsN/3YBN4xlZLkLiA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=anton.nefedov@virtuozzo.com; Received: from xantnef-ws.sw.ru (195.214.232.6) by DB6PR0801MB1991.eurprd08.prod.outlook.com (2603:10a6:4:76::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.567.14; Mon, 12 Mar 2018 10:17:22 +0000 From: Anton Nefedov To: qemu-devel@nongnu.org Date: Mon, 12 Mar 2018 13:16:52 +0300 Message-Id: <1520849818-6915-4-git-send-email-anton.nefedov@virtuozzo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1520849818-6915-1-git-send-email-anton.nefedov@virtuozzo.com> References: <1520849818-6915-1-git-send-email-anton.nefedov@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HE1PR06CA0148.eurprd06.prod.outlook.com (2603:10a6:7:16::35) To DB6PR0801MB1991.eurprd08.prod.outlook.com (2603:10a6:4:76::8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5749b87a-a14d-4fcb-0c49-08d58802723f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020); SRVR:DB6PR0801MB1991; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0801MB1991; 3:h5c8Gwgr4QDKttjG1U+W2gTKJn/pES1e0R2joA+LWsVMBvF2PPEGn2AVper5GMjVp3AMRbSuaKM4ro0bcmF/oofKqLlWIDn5Bz9dUyoxLDKn4h4Om8+9BiWom/1rJkwWzh8lTmnqbAEEKyKueUl2hDMqqB8fI/oYDDZsvTkatkusbacwIraFxRr6KmgW/oK6tnS7qDpQHyQnmm5ETqBV+aRV8Jl8+LO6mFL+UhwMLPJ7BPjuJDXGhHcxe+4qP3uU; 25:rTAro/E7D0yjKzV1MIE2MHwME/CzI8SEOAm29md5hJUf2hggR2kiEDWx0ATZX1bjWyw401KG/AJmsp0MW5to90ucsValhM/gNO1XP3KlCH7Gog+AmOyM8RaDIdloKD42c0dBYhOlQHJT0eWbPHqu2x7l81c37+Gk/zJQD5uVBC5sksndWutLPwMkl4Pb3hPDexd5lYtmSlYMfy/0g/mrYUkdLSVn15+V7j/xkbBcWK3rFIc7NxVV3RCFwlDcIBetART0eqJAPuZzS+Ko5IuHbtrdoDfIebpfb91PyqtN3H+w0KRZDbOKdsKSE4v7oLZWKmMClbt6JiJVswSJw8tulQ==; 31:lias+486g8wjJn7xQNPAEeM50ZWRYA6G0dRG0PNokQFRINakoNrax5VgECOiIkWvyadd7fS3uAC2qAzeFZ91wSdNf4lPSQef3bmWh7+IaE3ZmaS/igrJm5M95XRZKmHiohlI1oYFcj5iczzlzgToGl49czdvs8rpYRADadE9M/pWbVt4dCjdWYY4oDwDauwbiM3jnhDCVg4ZVL1hvIYs6YDEPanHPSjeMwy5oC+0L5k= X-MS-TrafficTypeDiagnostic: DB6PR0801MB1991: X-Microsoft-Exchange-Diagnostics: 1; DB6PR0801MB1991; 20:12Fl4EwN5Nvi/tIg7uKTtwQgAB9UIJbviJg/eAv/gOpy/Cpx8jgQVNuer54OIonIcvL1R+N+20tfaJ2FuH5JXHHKg29vifaiYxQtf0L8QO+eWuz5mML5kKLOyY8B6sz/tqF57/57kNn7jYl+GfkTybsOM2uXvc07MpqO23VJLq5gk8d7qTKd1iCdESg00Aj+ly1BwN8BjWpdJt3Ajmhh1KQ2AqhRjTRVhYwUggT8csmtrJay+mX0S2ByTyC4ppdaZN+rXJdGTKhFBfimvO4b5RQce+vmtDrd89elZgGpdz8DuX02RiCXJXxxDLxfd/jom5JYqDK56pbyjroqAcad9YVOhxTMRctfYyYi4TPDe7t1mUwsMhGhoVj8i/HnmiK4xGS/GX1I4ndO7/2bWj7R+48Lo9+RcaPbKGW73GjMY+WB5AAbY42gPRLNoY5svwfnmrv2s21RXrT8LVOMfA8MTIwKNOzcVUBTSe4HKx1+PFnSYbuD3plZLw4IIIL4ruMc; 4:hCilLmaHDVK7oELFaPtjfJcikLQNzxJvkSVNjMzMCKGW+JcKKosYmcR7VwYcxnhsCkys8zwLpo/HsKPT/e1Qj2Txkx2Eqo4+1i+THOZqjqW0JLPnF7oA9q9vPrHWiIYzMdSToVMtnIwS7VZ2yPwgIv1uWxroqqUfGfRG3Dzfy5mOvpTNmb5AHFRGFB7fLH+WpqOesbT645UDcTLfEgPIGt4L6SpGLi78Ic0VbqXV8uyDJpWtnN8loOsSUYbkZtZi7AgVQevlBsXKVuEL7vgI2A== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(3231220)(944501244)(52105095)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123558120)(6072148)(201708071742011); SRVR:DB6PR0801MB1991; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0801MB1991; X-Forefront-PRVS: 06098A2863 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(39840400004)(366004)(346002)(39380400002)(376002)(396003)(199004)(189003)(47776003)(106356001)(4326008)(81166006)(16586007)(107886003)(8676002)(69596002)(6116002)(68736007)(3846002)(105586002)(50226002)(386003)(6506007)(81156014)(8936002)(55236004)(2906002)(36756003)(478600001)(2351001)(2361001)(25786009)(316002)(6486002)(53416004)(76176011)(97736004)(52116002)(51416003)(66066001)(48376002)(50466002)(6916009)(6666003)(6512007)(2950100002)(5660300001)(26005)(86362001)(53936002)(16526019)(7736002)(186003)(305945005); DIR:OUT; SFP:1102; SCL:1; SRVR:DB6PR0801MB1991; H:xantnef-ws.sw.ru; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DB6PR0801MB1991; 23:wkyFYuV94JSXYoDqz50W5JvlmrfRp1a10sxJR+N?= =?us-ascii?Q?2Qt7B3yYd+DQD2b/23MIioHmA9Kb0L9LyRJW65457//kUJvbWTgcq1N8a34H?= =?us-ascii?Q?LfIkMSF9VjwljC7eE+D6RGBvsqSA43Pa2wOElF2eynbAgLvOjmHrr51o8XNt?= =?us-ascii?Q?mvQL3s9TZspYWBsEoRMyZ+WW1z4N1xBFOiaE0wgdJIcm4kX91GY/jYRmrkHi?= =?us-ascii?Q?/4K154AVFJ40TQev2OBT24jSslhC4K0y5JPOHw9qh+Geag2981BVPFmgf6VK?= =?us-ascii?Q?YFfu/jJp7zx/NNgbQH8VaQCYIztgils/dDm7/fuxH+HFqsaD0HMNO9aN5QcM?= =?us-ascii?Q?iBMC8mWO6p7fZenBFxFAUdzkASMv14KTmSpdgurMc0+zpKjjFWTGv78chxNO?= =?us-ascii?Q?mAaWXPy6kViBlu/AgjTLI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Hcsq7RTOcyurdvTz8dsRi7dk3kJwgFInWcLTXcKjk SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB6PR0801MB1991; 20:yjZkUZXmzwQZf7eNOn3Gj1SUToA609qdAzInHXFvH1otTkBmYZiMn7owcNCe9NFL9bB1A+xtGj1zrQ7aduWaR5FJk9X8k6Rk8oAQG1y/ORzdPtS/UPVjet9GukAU8mcafH3SfAOJcY8zSNhcCL66efXHFxBnV8YJRf/NIKCbYEk= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Mar 2018 10:17:22.3027 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5749b87a-a14d-4fcb-0c49-08d58802723f X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB1991 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.1.121 Subject: [Qemu-devel] [PATCH v8 3/9] quorum: set supported write/zero flags X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, Anton Nefedov , berto@igalia.com, den@virtuozzo.com, qemu-block@nongnu.org, mreitz@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Anton Nefedov Reviewed-by: Alberto Garcia --- block/quorum.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/block/quorum.c b/block/quorum.c index 14333c1..dc77a23 100644 --- a/block/quorum.c +++ b/block/quorum.c @@ -867,6 +867,20 @@ static QemuOptsList quorum_runtime_opts = { }, }; +static void quorum_set_supported_flags(BlockDriverState *bs) +{ + BDRVQuorumState *s = bs->opaque; + int i; + + bs->supported_write_flags = BDRV_REQ_FUA; + bs->supported_zero_flags = BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP; + + for (i = 0; i < s->num_children; i++) { + bs->supported_write_flags &= s->children[i]->bs->supported_write_flags; + bs->supported_zero_flags &= s->children[i]->bs->supported_zero_flags; + } +} + static int quorum_open(BlockDriverState *bs, QDict *options, int flags, Error **errp) { @@ -961,6 +975,8 @@ static int quorum_open(BlockDriverState *bs, QDict *options, int flags, } s->next_child_index = s->num_children; + quorum_set_supported_flags(bs); + g_free(opened); goto exit; @@ -1029,6 +1045,8 @@ static void quorum_add_child(BlockDriverState *bs, BlockDriverState *child_bs, s->children = g_renew(BdrvChild *, s->children, s->num_children + 1); s->children[s->num_children++] = child; + quorum_set_supported_flags(bs); + out: bdrv_drained_end(bs); } @@ -1064,6 +1082,8 @@ static void quorum_del_child(BlockDriverState *bs, BdrvChild *child, bdrv_unref_child(bs, child); bdrv_drained_end(bs); + + quorum_set_supported_flags(bs); } static void quorum_refresh_filename(BlockDriverState *bs, QDict *options)