From patchwork Thu Jan 18 17:49:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Nefedov X-Patchwork-Id: 10173769 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 034B1602DC for ; Thu, 18 Jan 2018 17:55:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E433927480 for ; Thu, 18 Jan 2018 17:55:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D7D0D283AD; Thu, 18 Jan 2018 17:55:25 +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 6514727480 for ; Thu, 18 Jan 2018 17:55:24 +0000 (UTC) Received: from localhost ([::1]:44609 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecEPL-0001Hw-AN for patchwork-qemu-devel@patchwork.kernel.org; Thu, 18 Jan 2018 12:55:23 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ecEJg-0004Mk-Hn for qemu-devel@nongnu.org; Thu, 18 Jan 2018 12:49:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ecEJe-0004Iv-AE for qemu-devel@nongnu.org; Thu, 18 Jan 2018 12:49:32 -0500 Received: from mail-am5eur03on0716.outbound.protection.outlook.com ([2a01:111:f400:fe08::716]:42208 helo=EUR03-AM5-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 1ecEJe-0004Ce-2z; Thu, 18 Jan 2018 12:49:30 -0500 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=wSDcWIWKcj5APoSYHWxJghyyqCiJF2bnWFE0iQsN+m4=; b=CyV4ePE4KWjODykUENCi+VrOEj3HB6oRCbA6u9CptZON8azVlURjzYpY08K7m8JDcJm9/bDpLDW06H5wryRsXOVkJOT/bk4mcNLz+Y/6Z4OtfPSq2wmog3Qa7LEEGtxR3vIRgD3asnj8DMEONzT50qJdsiFUuFC3a5wzo/A03ms= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=anton.nefedov@virtuozzo.com; Received: from xantnef-ws.sw.ru (195.214.232.6) by HE1PR0801MB1995.eurprd08.prod.outlook.com (2603:10a6:3:50::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.407.7; Thu, 18 Jan 2018 17:49:25 +0000 From: Anton Nefedov To: qemu-devel@nongnu.org Date: Thu, 18 Jan 2018 20:49:04 +0300 Message-Id: <1516297747-107232-7-git-send-email-anton.nefedov@virtuozzo.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516297747-107232-1-git-send-email-anton.nefedov@virtuozzo.com> References: <1516297747-107232-1-git-send-email-anton.nefedov@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HE1PR05CA0132.eurprd05.prod.outlook.com (2603:10a6:7:28::19) To HE1PR0801MB1995.eurprd08.prod.outlook.com (2603:10a6:3:50::8) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1bb29a77-832c-4062-684d-08d55e9bd103 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:HE1PR0801MB1995; X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1995; 3:AYXm/vFMwMiwSuSLjJWkCHziCJo4LxOQif02kTIwu43Y2kMf9n/YWBtFKqF09sLltvh5ycvOqoy5EWdsrw1Acog/p9dAjdGOBpWPc2DRX34OO8lCxAkXYDEpm23nDLhSjnyrTd8ALJz9F9P6SUoo1cB5NSYm4R7OaiUt3ZBSSjCPgjjTasTxfw4seZCgQoB0FHwDM8NXPKUkLXmLt81PED00ezgw91KTjsvRKsiwTzLHFvkrK0TmK5ZMAZKT/mFP; 25:nKXF/56axoGJixSd0AwSH4tVBwR9PRo3JfRQ27awIDDDt2LYf+YcfnuCzGuPmXJC78I0j6RBzNV+zq16XCidwuaOVgYcjyQ7DPS3RAgF6hkNYk/gdEMK1DbxiSpvLBcuEWN0PDApY1aW4WPIFs02upt859FWIH/VIpFYsAhSOCptMIn1kMBITg/2OKt6o6k9dWFhxhsiQHqA/Hr2h5+49PKEueUlnNwjKU0WenakaKftrPt3UaKzIpCbokC/nDwpeFwlM01DAT0oFxKuWy2VDwlwesZ1kJeW0rFFXu8Fru690xX3nG/p8BoELwrVWi0dnHiMD8jn1zsOo70zisPm2Q==; 31:sh4mu7Tbsz+f/YHCkrt/n9IQmSuQv2ua+9UsE9k3CAnru0MRIZIhQN336gA2k+TVZuIIEng9Z2Ysg7nucyQB0BlZGkZmlsL1+6DK0kRBEb8LDiQLY7nLkTOXfPJAiDR4EX0X5W7/bPYBeXBN1V44ue87lfL9pavqQookoB2O9RrTYNJGRM9iV1MWZsu+M1bgfkYLVQ3Sc6zReBKNGQSQiO3zmLB8gIvKUEHjcoyRpzE= X-MS-TrafficTypeDiagnostic: HE1PR0801MB1995: X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1995; 20:WBNz8O6HSIThnXh/lrNesu0tIqHHoQ2SNaG6a459Bo7Y70l8zmL0m8QoiKr3QrC1wTfHOirtwg7PMk99wraycv3kYB08och7OYctANZM482PSGKDLBNrj0CHXBEbk7LQ+ZKnayiTofTa9JCaPgVUD7LrcHY8/70aLeV1ddobG6HjHSuiky5Cj3zFLTksTOMcLX10OMELZ8zPUCeM6g13L0ipvDteJ30kbjhVu7IeFOAcxTXZyevFwBCZwK+1Du+LUxaeBFl5s57cv1LWMY1tGUmh5myiziXS3wOY7otkzAoRkBTrucnxYbdLVFQE5pWhbO8m1xHzj3C7PVzQbudVJOK3g9OJHZ0UaXDkgvOB3mLjvgIpEdl7bHKkgoQ6uqSNY46csV5D6045rwb6ZgwzGjyrp74M+u7I2YvD83F8Zw0=; 4:sxQbb2QyeMiBz87ckdS5s2VOYxOxG0GorQ65phOGRKChJs+uTvSFXCdndzypO+NlPxm2wUOSTpxfbzzawc86O347qVbEkqbGto/wQUw3pLegT0UnBeACXe2rOIZJJdyz5Njqil0G6nK9BEEkP/3hZYyhJ2s1/Bq6UYimfjWYpx2pSFbuhssmXDiclLkTNFOKSUaf/Ii4SmCJk1IJTGzjmUa4SAfayWJNladVoPo1nFsTZY8CpHzZU5GBfOOBBFK1NZxA2YimImokfx8NwVjvTA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040495)(2401047)(8121501046)(5005006)(10201501046)(3231023)(2400065)(944501161)(3002001)(93006095)(93001095)(6041282)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123560045)(20161123562045)(6072148)(201708071742011); SRVR:HE1PR0801MB1995; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:HE1PR0801MB1995; X-Forefront-PRVS: 05568D1FF7 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(346002)(39850400004)(376002)(396003)(39380400002)(366004)(199004)(189003)(50226002)(6512007)(16586007)(316002)(2906002)(16526018)(53936002)(2351001)(6666003)(5660300001)(66066001)(51416003)(6916009)(69596002)(7736002)(2950100002)(86362001)(2361001)(76176011)(478600001)(97736004)(107886003)(105586002)(50466002)(6116002)(47776003)(68736007)(52116002)(26005)(8676002)(6506007)(305945005)(3846002)(386003)(36756003)(81166006)(81156014)(53416004)(6486002)(8936002)(25786009)(106356001)(4326008)(48376002); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR0801MB1995; 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; HE1PR0801MB1995; 23:7DGDMUCe/+zDip8I97pgJM/AHae040jNOJzrXhf?= =?us-ascii?Q?eo5lFEl0iHQKU3Mc5c74mSGQ1tRi6kNtGQF7mc5qvplk2GYjR2m8KA4Ko36k?= =?us-ascii?Q?AiBvESWeunHJ6IpSH+XI3TCiz2KhrmXi6IsK4hE399DFaRLoXliZXaq+kKUn?= =?us-ascii?Q?HFWcX10U3f3oI2pwqO3hA/Jwcw2HWADv2DyGQTwVQPQXXlaLWZuDTU9InTBV?= =?us-ascii?Q?OpkHAYmIv/vWFueoAe+cfzbv9z4+C6auepHKoSNBIKCnmRyyoMD4kCqGfTNz?= =?us-ascii?Q?MnP+3DbmYNy0U7SolHeXq3ftnvGwSIFU/wXkKJy8WzYQHDIDSWmfBwhtGIV5?= =?us-ascii?Q?UyvCoyCraaI3Rjkw6GfkK5si25aaX5RGHepdG7rpRjqhwJNPNAi7qlQG5mZR?= =?us-ascii?Q?xxe1b+e0f18jE7T98iV4GYGNbeqUhlyu3xWnR30lUCTBO4WSz+i4ZD70cr3H?= =?us-ascii?Q?b4I1RFUWKhtvz4iTiH5YrW//wN8nDxSUuL98TlCbOzKp4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zYbRcsNZvhsAg+DTEngeww3T6AtgPMCEDVlCNqVGp9NYQcC4rcJsugbcntbNO8KuOWErSTuspBH8kgPUCkoQEuJdl+N1hVCphqgK1ef97eTnNb/z6RmFGzVcZtSrMzvVyhTjT5n8vsA2G5o1fdbCN2uQr3aAbyOkucKoI/Uv+U+FgeicJuvUGfbA=; 5:e1qVH/RBhhi/UPMpNaNdovQWvCh57espfJnliRSJnD3jx1ssasDjgMK4Py/cIrAsZOs4YLpdZTG9WilPW5oP8ZFPReFODYF5YS4N/E2T5hRt37er/OV9ghyGhRjs5SIXUSz2gCr8Ue0H8m3dhgtxPGlSomCzuMbRTeCbtSkaBwI=; 24:cx3bPhWOIhJTdCBId5qfW8RYotkG67lg46H7McDsMMU6LIxJiyocdPVZURN54Pkdz7XJ79xJcwW/CbuHKwiciNi9B8vqdiWWEr4voXWlYCM=; 7:9cpJZbtf48cz2rr+avT30iTdN4ZViqAKCMGM2xTDe8zqgtIX+Fc+FOgVX02w/zcwPwdv3bEOpVfx2X/rGZjfsp4ruo7P0ukheLu0nZvq8i8nxZj2a7KWqq9v4jl9T5570Suxv4Klk3PME/PcK+a2+1Omy1nW9RUaE9mLqw1vs4rBzSDN6e1/nFbord6zAW1PFqJ37kuqxHRO9uQmLizIipK0YynHlsLxKD5DqNsTzjNtjyKrzl2e52XVr5zaS1Mr SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR0801MB1995; 20:kX5lEISvJ7KCR6SivtneARVo2A/NaDEdgbLGS15jQvueutuhhdb66ZrciZU9Bn4dccdEveCroLVlVCoKxhXCvM0e9bJ8FSNWLdbcxC6FsIv7tfQHOQMVLZjfFW8MShOJyE/avqK1yJG9LEjjnWXZzS+YISrSa9edljAKpsGB/i4= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Jan 2018 17:49:25.9583 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1bb29a77-832c-4062-684d-08d55e9bd103 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR0801MB1995 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 2a01:111:f400:fe08::716 Subject: [Qemu-devel] [PATCH v7 6/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/raw-format.c | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/block/blkdebug.c b/block/blkdebug.c index e216699..7d5773d 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 9ba65d0..b249636 100644 --- a/block/blkverify.c +++ b/block/blkverify.c @@ -145,7 +145,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 d18ec65..eb41deb 100644 --- a/block/mirror.c +++ b/block/mirror.c @@ -1067,7 +1067,7 @@ static void bdrv_mirror_top_refresh_filename(BlockDriverState *bs, QDict *opts) 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/raw-format.c b/block/raw-format.c index ab552c0..b1deb93 100644 --- a/block/raw-format.c +++ b/block/raw-format.c @@ -416,7 +416,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)) {