From patchwork Tue May 8 14:58:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 10386317 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 1227860353 for ; Tue, 8 May 2018 15:03:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F2BB828783 for ; Tue, 8 May 2018 15:03:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E706A28D1D; Tue, 8 May 2018 15:03:05 +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=-7.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, MAILING_LIST_MULTI, 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 3974428783 for ; Tue, 8 May 2018 15:03:05 +0000 (UTC) Received: from localhost ([::1]:51655 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fG48u-0004EA-Gt for patchwork-qemu-devel@patchwork.kernel.org; Tue, 08 May 2018 11:03:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47921) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fG44n-0000Ji-Kg for qemu-devel@nongnu.org; Tue, 08 May 2018 10:58:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fG44j-0001b7-Gw for qemu-devel@nongnu.org; Tue, 08 May 2018 10:58:49 -0400 Received: from mail-db5eur01on0090.outbound.protection.outlook.com ([104.47.2.90]:24016 helo=EUR01-DB5-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 1fG44j-0001a7-8C; Tue, 08 May 2018 10:58:45 -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=Uqjga9BaNVylnen/0PMi+1TMal1Cf6GtYZ6h42DDbjk=; b=MvPlOhswW++TiKUqlaSqYiKODf/2UNPiZM3WYvmb2f2KBOUNQushqqBtE2sc97pOMNVoQ6lf/ZZpajQYYH6Vu0PmBh8tTdDB6ez3sOhv75GxrMvrHLpvbBS3Z9Bnq7qEEpas2qt5aSiOSY+FZHiItqCs2LZC49RfqLslc7t3Smg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=anton.nefedov@virtuozzo.com; Received: from xantnef-ws.sw.ru (195.214.232.6) by AM0PR08MB3347.eurprd08.prod.outlook.com (2603:10a6:208:5f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.755.16; Tue, 8 May 2018 14:58:42 +0000 From: Anton Nefedov To: qemu-devel@nongnu.org Date: Tue, 8 May 2018 17:58:14 +0300 Message-Id: <1525791496-125188-8-git-send-email-anton.nefedov@virtuozzo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525791496-125188-1-git-send-email-anton.nefedov@virtuozzo.com> References: <1525791496-125188-1-git-send-email-anton.nefedov@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: DB6PR07CA0020.eurprd07.prod.outlook.com (2603:10a6:6:2d::30) To AM0PR08MB3347.eurprd08.prod.outlook.com (2603:10a6:208:5f::20) X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(5600026)(2017052603328)(7153060)(7193020); SRVR:AM0PR08MB3347; X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3347; 3:2ASzc/8M63+8+X2fDedKdzUpF9vAGX04d6QMtudotkUGIQWU0y/icpCtYub8nGtdmzrodT3GTEEXF0Jdwgz1OXW0y3BIVLbaNTau2WzofYaP8nyUcZwpduvFYGtaBu7o19e5d8um6YT/EyoQ+zcLM7CPdBqm1UC4FDstFSLYwhUH+rLKVgekme0MrQvfygG3LVRhMdHGsIXjACGLtBvleWz52WoFBPRPNYeP9bamDGACPAHEwo4Bxl//EJb8p3JC; 25:eK6wK6ilfkct2BA8nP8k+Rq3Dd+n4HUqZNzCA7uPvIEVLzIcUWH+0Wb+5/fWHB4u5PQ2BOeqWq0J+dFCkbLUocKqKBKHmsCpzF2OSUo9HsmwE/Y+XHzkLsegMu1dnRExLgtoD2psuK7XuUutJusgeg0lIVc4knfMh6K26qR0j8y8h7NDU0BBBC3V/9aohp1aLSm/CSgDblRp5PiuodPWj0db7OL/Ym32neu72issbET3lJQ0OnJKT+vOv2MfmZS14JJazHDcB4Cn+lQeDWtYu2TmVkfIXmO2NSshExKu/64k1Jc9xIk7egUzecwMlKLMBW6iwURnpTqlYnF3NVN5jA==; 31:39G1XHnktlQesUP0SnyZwC1wyGU21DY/1U8HJL9aEyFEqwkBc5nnJwblGD/yxIBAxmlo7MJMjJjENy3VsdakJ7nGEuDWCrUkUbeiBVJgkAKQMvsBF+ZEWUCHlBezVACkgcpVDgvZySZ4SDt5eS6KftHzv/OLN2pTXNn3zAyyO16dxinGKeOew9sB6qoAEGwyc75X7d/xZZNgfZlRQxjkKI14T7yPdPpJnvUrNEylXJg= X-MS-TrafficTypeDiagnostic: AM0PR08MB3347: X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3347; 20:Hr0HGLBEs7XVh1uwpM/MxJ2y832AbhjsC3pm+vvEZMyIDYmI5mPw1CztdMNORc10EGfPH5sTGV8Qj+H0keayewnF0WGEbCLrEEU3DfNg0d7O5w5bo6JQ06JaRiw+u0pPghQG7VR4pzCvG8QvFz9EOjEbJ1LZLhe631ICRDbD0yhLjkQukR1gZvt+ifXF7dWuXc6Aok/wYTMrWI0vlGHzApUgCkKnozIQ4tS8oZzxFo/lVo0oEAWOwMLYwDeXD4nOHMQrONKiKsypzLwvNdFSA8fCn/sxdtSJBFPUQr1NJmoY7liCbrT9Ro1tcpVx9v0C7RXoEp3QuE1REwwRM/LsSKnvTVZic60T0SiDaC43u18tj1S+J44d9WN4Gqk2aX9pCTFrMezlLDDVSQevkf9Ak7EhkulcmRhUQCS5jq6bFDi9kcGTfRftqfYVkVPbkNZ/fB18G3yjQV7SrYqnFcucakjlLVO1f5QhZV9dZQKC6L9keehN8Lf9WL8a1sxuqxFa; 4:nLabi3Kz0PfaGAk1jkJCVZFLhzdMjdsVup4JxMTfiPhMARAphlm8rQD5Ai/QwqexS/P6W+PWApV4oz0BVtAvIwYEvtbw7nYG14GgfpfxGwrwXTRA0XXAF5YsvuQWC81gSbXCJeXwEeaA+2hSxM+kzG8d1Em0NYKpinQ0R718ut1LAxRwktudK6TcUmpDgpmkuH+hzvN6+sKkFm0odpeP5SQ/4tybqpWxlaBG95IBdwFmZPZKiBcHsgaX/Y7nyPDiRSRknCEpfd6GdEZcgJHXKg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3231254)(944501410)(52105095)(3002001)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011); SRVR:AM0PR08MB3347; BCL:0; PCL:0; RULEID:; SRVR:AM0PR08MB3347; X-Forefront-PRVS: 0666E15D35 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(39850400004)(366004)(376002)(396003)(346002)(39380400002)(199004)(189003)(5660300001)(6486002)(81156014)(8676002)(81166006)(97736004)(2361001)(6116002)(3846002)(2351001)(446003)(2616005)(44832011)(16586007)(956004)(486006)(316002)(305945005)(476003)(86362001)(11346002)(25786009)(68736007)(6916009)(6666003)(36756003)(69596002)(51416003)(66066001)(47776003)(386003)(6506007)(52116002)(8936002)(26005)(53416004)(55236004)(76176011)(105586002)(186003)(106356001)(16526019)(107886003)(53936002)(4326008)(7736002)(50226002)(50466002)(48376002)(478600001)(6512007)(2906002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM0PR08MB3347; H:xantnef-ws.sw.ru; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR08MB3347; 23:Z2lxJJUBcBUEG3dj5+g6ASwn4+C4oCCkRrSsY0xBY?= =?us-ascii?Q?GFGxuuwnzFAv8Cb2HnchKiaDPa03TG6T2yvfkze4FOPfQkMkxEHh3E+Nq088?= =?us-ascii?Q?82eZG3wNYF34IZ4eVkCcS4sqaHPOEbnpGiIu7V5fPIySQBqG6MOqkCzh92kN?= =?us-ascii?Q?bO2nnRuUfV0a1qZm4JQ7+QyY57rXWje6XtZMmdRlrXAUWeYXHwh6xVpBBYrZ?= =?us-ascii?Q?COPOE9EQaAVGXTGGtuC1vWQ24j17PtFzMhu39k7sZ4XZ6fIg8RTtn0kcYhft?= =?us-ascii?Q?cxxsrS99Sm9+0S2ydq8NN2rnJ/td0vhRcpomSdt5081/mKkKoiHJ84t6oGy1?= =?us-ascii?Q?7Z5S+W/TvPRnH2Pk5WG78ABYF+Lh54qk1sLtEA+w1Geey88Fg0dFc3baqfc0?= =?us-ascii?Q?+zMl83SIOO7n6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 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3347; 7:h/DMS1InWnNGwOUZAjpghmbfD9zAzyN1Ls+CXp1Ryke80cfqFiiku+qj50mwopRSprot2UZrE4G5L4etLpiaSYp/JyVMQ8WdixdGsnxC8IcuJYV/PdszxmIC0PTqzlHyqnp9zYcDnAN9VV9M8CPoZkW/shX+1TdJhnnaGx0Q4wsWt4S2RMezMq+bb+Pw4+Ri3WcnW99QJ2td6c/QrPWaizlhj2eZeKe1WbhBxiHFhYZfgv1tyQnmY/e21bK7Z7mz; 20:iQBTyhwfOAeaf8o/Q7Dw9NZotb8oHvUPD5aKC9pdhrTa/PpWuazhwOMPIHEP9x4rINaGIFD8R853VXNGxIyX50PsEBa7PpOGTo3SKmCWT7w3lD7HvCKJouXIhuMai0y6SAE9K+sYER7Tq3K758BIM8jxJxhaJJscSw4J403Bzn4= X-MS-Office365-Filtering-Correlation-Id: 2adc3ab2-aeae-4891-22d1-08d5b4f43132 X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 May 2018 14:58:42.2557 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2adc3ab2-aeae-4891-22d1-08d5b4f43132 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3347 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.2.90 Subject: [Qemu-devel] [PATCH v9 7/9] block: support BDRV_REQ_ALLOCATE in passthrough drivers 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 Support the flag if the underlying BDS supports it Signed-off-by: Anton Nefedov Reviewed-by: Alberto Garcia --- block/blkdebug.c | 3 ++- block/blkverify.c | 2 +- block/mirror.c | 2 +- block/quorum.c | 3 ++- block/raw-format.c | 3 ++- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index 053372c..f5f1232 100644 --- a/block/blkdebug.c +++ b/block/blkdebug.c @@ -400,7 +400,8 @@ static int blkdebug_open(BlockDriverState *bs, QDict *options, int flags, bs->supported_write_flags = BDRV_REQ_FUA & bs->file->bs->supported_write_flags; - bs->supported_zero_flags = (BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP) & + bs->supported_zero_flags = + (BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_ALLOCATE) & bs->file->bs->supported_zero_flags; ret = -EINVAL; diff --git a/block/blkverify.c b/block/blkverify.c index 496ae09..fa95f22 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -146,7 +146,7 @@ static int blkverify_open(BlockDriverState *bs, QDict *options, int flags, s->test_file->bs->supported_write_flags; bs->supported_zero_flags = - (BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP) & + (BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_ALLOCATE) & bs->file->bs->supported_zero_flags & s->test_file->bs->supported_zero_flags; diff --git a/block/mirror.c b/block/mirror.c index a22ddef..6fb3aa6 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -1103,7 +1103,7 @@ static void mirror_top_set_supported_flags(BlockDriverState *bs) bs->supported_write_flags = BDRV_REQ_FUA & bs->backing->bs->supported_write_flags; bs->supported_zero_flags = - (BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP) & + (BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_ALLOCATE) & bs->backing->bs->supported_zero_flags; } diff --git a/block/quorum.c b/block/quorum.c index 26e7d78..349bdc3 100644 --- a/block/quorum.c +++ b/block/quorum.c @@ -873,7 +873,8 @@ static void quorum_set_supported_flags(BlockDriverState *bs) int i; bs->supported_write_flags = BDRV_REQ_FUA; - bs->supported_zero_flags = BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP; + bs->supported_zero_flags = + BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_ALLOCATE; for (i = 0; i < s->num_children; i++) { bs->supported_write_flags &= s->children[i]->bs->supported_write_flags; diff --git a/block/raw-format.c b/block/raw-format.c index a378547..ca65f86 100644 --- a/block/raw-format.c +++ b/block/raw-format.c @@ -417,7 +417,8 @@ static int raw_open(BlockDriverState *bs, QDict *options, int flags, bs->sg = bs->file->bs->sg; bs->supported_write_flags = BDRV_REQ_FUA & bs->file->bs->supported_write_flags; - bs->supported_zero_flags = (BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP) & + bs->supported_zero_flags = + (BDRV_REQ_FUA | BDRV_REQ_MAY_UNMAP | BDRV_REQ_ALLOCATE) & bs->file->bs->supported_zero_flags; if (bs->probed && !bdrv_is_read_only(bs)) {