From patchwork Thu May 28 09:43:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 281796 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EC1F7C433E0 for ; Thu, 28 May 2020 09:45:48 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B8D64208DB for ; Thu, 28 May 2020 09:45:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="n0hieR+l" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B8D64208DB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:37926 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeF6h-0001hy-O9 for qemu-devel@archiver.kernel.org; Thu, 28 May 2020 05:45:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37606) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeF5O-00084t-6O; Thu, 28 May 2020 05:44:26 -0400 Received: from mail-eopbgr80134.outbound.protection.outlook.com ([40.107.8.134]:2978 helo=EUR04-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeF5N-0002k0-Ci; Thu, 28 May 2020 05:44:25 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VR7MblqJbfZnwpomGo0GrKUhpYaUSab/kYHgoL70aPAy8XQFNmS57Vqhb8wMeSULXj/GRHpyGQls+ki1mdzoLJ1kOzM2sPWOSwRk3O43HDtw9muwu7oqyfqbikej/68qoi3Ca5w/Ro11MQvsFf0vwpNdafAbVlKRakN6lqPpBZYiB6zlImL1aaBZqMj6FmVLaOU77Mfr/PMxu6vB9VvaIPOfFEmdxMnnVbfxcxvh+eOTHl1KgfqC59CTej4bm96Rf1/D7kWeoWoVQ0pBrYpZ28vGSdIlO6TN+oEK4cP0kXlDuM5sYnOimfwgUVaUrilL6KFuMbFB+HplCZQsORwU8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MfC4Cz4jbnChRj77AzLGlNCwKOcwXVbPBerKDlE+nPs=; b=ViTe8I+7Jf0FBKDS0oOc0yadZWN2KqRrtmapF5qXZv4mMXQsqe9PgNggleuTspXwkfBX2hYU7mUhVEWXdGIQskg/HUi55LFNlFCy/yWTTGCooALb8qvMNUWku8WkRH7LE0hmS0Cwr2mhlIaxmtw3edK/MzObiDXNFbO3bVrO/iC+VPteYt0hxDauflIjQKwDxtGA05jr48gJK/vS5r1KKIyxv0oDKjJiQMPKm+JRp1D3gb/LppPXaJeZ6iKVEjPjsI0ZZmOBrrxaAVhtgZ6gS/byxZTVUIx+aIgkLPytwaYq5hFTKMIPr5xAJ18SRgNkEnhcxcep9r5fEHMfPQM0nA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MfC4Cz4jbnChRj77AzLGlNCwKOcwXVbPBerKDlE+nPs=; b=n0hieR+ld6vsIVU2z4UHOjuvey0qkLw0xbil905NCSQTQwDhzhS8kI0gEkWMc1dYO1SDZ0fBMZwsOqpvLTyJvh8XpT53FbxFEAKJ0k8cBvcw1aOSbXEsnMC2UWhIKeqitwlwabP02rjoDk8jITGCle7G15fY/f5l0XWBAKhzz+k= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none; nongnu.org; dmarc=none action=none header.from=virtuozzo.com; Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5366.eurprd08.prod.outlook.com (2603:10a6:20b:10b::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.17; Thu, 28 May 2020 09:44:21 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::a408:2f0f:bc6c:d312]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::a408:2f0f:bc6c:d312%4]) with mapi id 15.20.3045.018; Thu, 28 May 2020 09:44:21 +0000 From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v3 02/10] block: inline bdrv_unallocated_blocks_are_zero() Date: Thu, 28 May 2020 12:43:57 +0300 Message-Id: <20200528094405.145708-3-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200528094405.145708-1-vsementsov@virtuozzo.com> References: <20200528094405.145708-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: AM3PR05CA0089.eurprd05.prod.outlook.com (2603:10a6:207:1::15) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from kvm.localdomain (185.215.60.178) by AM3PR05CA0089.eurprd05.prod.outlook.com (2603:10a6:207:1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.19 via Frontend Transport; Thu, 28 May 2020 09:44:20 +0000 X-Mailer: git-send-email 2.18.0 X-Originating-IP: [185.215.60.178] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ddb745b0-ac18-4ec2-58b5-08d802ebb2c8 X-MS-TrafficTypeDiagnostic: AM7PR08MB5366: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:334; X-Forefront-PRVS: 0417A3FFD2 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CkYbRTSOWI5jb/e2Z8KnSGJ0aBKMQcfr3JzCnz86iATGdoYYRWcHxnqlsUyO8Ja7upufhwRztzf2/i0MvrTlHARkyGaUMe3d4jWVPP+QmxQKn8tOahU4DlV6UGlk6eppYZ6+kagZEnipr/4i5hHFMINhsyygvmzpEQdMVhrgUuPwiosBqYKddTz98lP+NSh/FnJb+iL6rMrdbkRPVTHxKDjL4czW5bp+EEUlszvxczm22UsarPUtK42sAlHU3dxEIp5M8b8dBXSlRIWlsgxY1tL8jXqJ0Yx0fOg+H1jwWv4ePOovoJe/20KxuWnQlm2iRdCaM6DF41dv2kYhppwpCw== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39850400004)(366004)(136003)(346002)(376002)(396003)(2616005)(86362001)(316002)(5660300002)(7416002)(956004)(1076003)(6916009)(66946007)(83380400001)(6666004)(66476007)(66556008)(8936002)(4326008)(6512007)(36756003)(478600001)(8676002)(26005)(186003)(16526019)(2906002)(52116002)(6486002)(6506007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: l1ktUWUCL7mgKJ0Xc6k8Hok07mYOGcRGJSJg2HfIHHtNH7i0KNwypAxRQy/JTc2vJbE8iFkbAiRXbDpS9wYWt5LYmB2JugZl6m1L+qWSZf9c5WrJJBCFCJ7Yd0IYUQ73jbRL+5Q8EU4aikV5LOwte+sQHSe/plueY2YZWPyEDSslS6B1cpF9Dtoa/WMQ86vRIsixy2NrP0YMo37mYxeCIzpFuLbekrlx+RyER/cvXqMKX8fqLipEhI3fRvu1BQ94DCscn6p9kMndHG/JVl2XDvnGhheu5LdLqiRUtIo9dldZDMxAjTFUhlJCvZ6WeKvcmyAVuZuK6z93/mKCA0CpOFOHz/2aH2be5Dj5fVV0Rvf/DOFULrtk9NLLrF+AekB8LGYOKd7Gcwt035D58EKEKbGlyIs9qT335PGcbfy++iZ2vqnofEsuP1JODTGDUs2fPmeGQrGeFcgOKiGURPLwGbBFLjC6P/Nvwky1qt7QrSY= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: ddb745b0-ac18-4ec2-58b5-08d802ebb2c8 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2020 09:44:21.4766 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: PgOQ55wtGxCGvqRCUgtkFVxkrBMSwtNztr/1tsakpM+o0/WtHKn7re3VThWpche4fSI+ovmj1JgS0LjN2pqthy8NZBkTdnn26NnrX06HATc= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5366 Received-SPF: pass client-ip=40.107.8.134; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-VI1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 05:44:18 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, fam@euphon.net, vsementsov@virtuozzo.com, ronniesahlberg@gmail.com, codyprime@gmail.com, sw@weilnetz.de, pl@kamp.de, qemu-devel@nongnu.org, mreitz@redhat.com, stefanha@redhat.com, pbonzini@redhat.com, den@openvz.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" The function has only one user: bdrv_co_block_status(). Inline it to simplify reviewing of the following patches, which will finally drop unallocated_blocks_are_zero field too. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- include/block/block.h | 1 - block.c | 15 --------------- block/io.c | 11 ++++++++--- 3 files changed, 8 insertions(+), 19 deletions(-) diff --git a/include/block/block.h b/include/block/block.h index 25e299605e..68699ebbfa 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -488,7 +488,6 @@ int bdrv_pdiscard(BdrvChild *child, int64_t offset, int64_t bytes); int bdrv_co_pdiscard(BdrvChild *child, int64_t offset, int64_t bytes); int bdrv_has_zero_init_1(BlockDriverState *bs); int bdrv_has_zero_init(BlockDriverState *bs); -bool bdrv_unallocated_blocks_are_zero(BlockDriverState *bs); bool bdrv_can_write_zeroes_with_unmap(BlockDriverState *bs); int bdrv_block_status(BlockDriverState *bs, int64_t offset, int64_t bytes, int64_t *pnum, int64_t *map, diff --git a/block.c b/block.c index 8416376c9b..34adf1298f 100644 --- a/block.c +++ b/block.c @@ -5408,21 +5408,6 @@ int bdrv_has_zero_init(BlockDriverState *bs) return 0; } -bool bdrv_unallocated_blocks_are_zero(BlockDriverState *bs) -{ - BlockDriverInfo bdi; - - if (bs->backing) { - return false; - } - - if (bdrv_get_info(bs, &bdi) == 0) { - return bdi.unallocated_blocks_are_zero; - } - - return false; -} - bool bdrv_can_write_zeroes_with_unmap(BlockDriverState *bs) { if (!(bs->open_flags & BDRV_O_UNMAP)) { diff --git a/block/io.c b/block/io.c index 121ce17a49..6f9507f718 100644 --- a/block/io.c +++ b/block/io.c @@ -2387,15 +2387,20 @@ static int coroutine_fn bdrv_co_block_status(BlockDriverState *bs, if (ret & (BDRV_BLOCK_DATA | BDRV_BLOCK_ZERO)) { ret |= BDRV_BLOCK_ALLOCATED; } else if (want_zero) { - if (bdrv_unallocated_blocks_are_zero(bs)) { - ret |= BDRV_BLOCK_ZERO; - } else if (bs->backing) { + if (bs->backing) { BlockDriverState *bs2 = bs->backing->bs; int64_t size2 = bdrv_getlength(bs2); if (size2 >= 0 && offset >= size2) { ret |= BDRV_BLOCK_ZERO; } + } else { + BlockDriverInfo bdi; + int ret2 = bdrv_get_info(bs, &bdi); + + if (ret2 == 0 && bdi.unallocated_blocks_are_zero) { + ret |= BDRV_BLOCK_ZERO; + } } } From patchwork Thu May 28 09:43:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 281793 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E01B4C433DF for ; Thu, 28 May 2020 09:48:32 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A2705208DB for ; Thu, 28 May 2020 09:48:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="hynXYIb2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A2705208DB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:53060 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeF9L-00004r-Pr for qemu-devel@archiver.kernel.org; Thu, 28 May 2020 05:48:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37610) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeF5P-00087v-KR; Thu, 28 May 2020 05:44:27 -0400 Received: from mail-eopbgr80134.outbound.protection.outlook.com ([40.107.8.134]:2978 helo=EUR04-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeF5O-0002k0-O7; Thu, 28 May 2020 05:44:27 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m3GK4HVAOjqHb2vnltIeU/SMwsFY6nEqlKMqZjYuUHT6Gshnzxm7EL8Yxov5MrIOWvYmSzBJWfQCnj10Chphi8QoGeYZMWUf2SmIFcDLbYjpVG+igz/W1glXY9a0fv5H8lX7WCT6+dffzWm/zvD71oYm/6mC02NG8kDF9Pw1bNwuw8/DBMFUdPY860StQ0WTOYYj8JP7S8tPjGe7Ya0VxYfOX+1HiQUS84cCHI9JYXLHzfTEf0YTmOOdpsIcbnUcR9HnV4rEHFQmaaQJtTrcm5u5Q34Yd5TA7uCFmSbgMWrUFR+VvjxS1e4vSGLPpPo6vSX7xMRW20dWs/68duyKCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Q0AmImOQ33k5aSJq+SXqWhrtj3a5yCp8P+hPQlOK8ZU=; b=OJ5lc/2G0DhvowTAvCi6V/JDVcOjSH5brnPzFpY6Gfz5I605B7vv9lDs3nyE+pQ28hPfXD2nN7nCK9adob6K3/Vw0zYG/u6mM1x+isT1kA2Vyz7QXcJIx78nsHOK6XpGVlaeTrJNjPfLREPxYIgljamO5WPFsjjKwSoJTxDWJwuQ2K+2by77mPs9RIPlWqSqj4mb6WNbMbNTWLa2qYrSR4D4LY9jo3hilraGU7ZLui1rwlmc23oLFHMDMoLMgahgSsd87+GP9xWvjiR3sMHyI6Yg3CBwrsOnilld/KFdgmv4zP0XrmxPWaapYZkF45c8ZU4kUZYIU30Nb5FzkFockQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Q0AmImOQ33k5aSJq+SXqWhrtj3a5yCp8P+hPQlOK8ZU=; b=hynXYIb2IZ4QBH2yq+WY5KL/LeSW4vohFdYEXKyrtQMXnEIq8g0FDL2nrrgriErlY+14Ep5vSuoL8m5s+7TOovDVzKp4BpjU6SkhEJiX4Buf7rww5rnaoRl9ymNzjfYCUT8hltVz3+RnR17BrwRgOgcCIVw9ekiJYy3X3A8VaXY= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none; nongnu.org; dmarc=none action=none header.from=virtuozzo.com; Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5366.eurprd08.prod.outlook.com (2603:10a6:20b:10b::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.17; Thu, 28 May 2020 09:44:22 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::a408:2f0f:bc6c:d312]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::a408:2f0f:bc6c:d312%4]) with mapi id 15.20.3045.018; Thu, 28 May 2020 09:44:22 +0000 From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v3 03/10] block/vdi: return ZERO block-status when appropriate Date: Thu, 28 May 2020 12:43:58 +0300 Message-Id: <20200528094405.145708-4-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200528094405.145708-1-vsementsov@virtuozzo.com> References: <20200528094405.145708-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: AM3PR05CA0089.eurprd05.prod.outlook.com (2603:10a6:207:1::15) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from kvm.localdomain (185.215.60.178) by AM3PR05CA0089.eurprd05.prod.outlook.com (2603:10a6:207:1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.19 via Frontend Transport; Thu, 28 May 2020 09:44:21 +0000 X-Mailer: git-send-email 2.18.0 X-Originating-IP: [185.215.60.178] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d2383c79-ded5-46bd-f45b-08d802ebb372 X-MS-TrafficTypeDiagnostic: AM7PR08MB5366: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2887; X-Forefront-PRVS: 0417A3FFD2 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /UWHnLL7tw+ky6OmCkU/PR2R2wR87Exvu2Aa/ozP4moYlbcnsfb+iCat+M1FNwvb+OynpG97oIZZW886AndjlDk//elBojLqBQCU9Ih6f3fw0WKE51/N08cZg/kFFsXw1LtrVbORbXn4nAedWLW3u9XHUPo/OZ2DqNscuNcVixeLbt5zf/u6tCXZueJ9A6F9QELphT0dz+3sqRqFw/HU9LUaFgk4znWpAv4hcmn6J9n49dD8n7/kYIEbRF4uHHaheHUNVbLs0XB+c3WGjUBCl8VoD6mU+sNggBU0al4+it7Asiat+7dRuJilITtMtXxz3LP4HY8FsZ/yKSubQ8ad2g== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39850400004)(366004)(136003)(346002)(376002)(396003)(2616005)(86362001)(316002)(5660300002)(7416002)(956004)(1076003)(6916009)(66946007)(83380400001)(6666004)(66476007)(66556008)(8936002)(4326008)(6512007)(36756003)(478600001)(8676002)(26005)(186003)(16526019)(2906002)(52116002)(6486002)(6506007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: Sbo3uTzkvk2TE++lgl/ID1O1syqE4ZU+bsUFhsuxuZ9GBF4eDSLXZeQlow/PfIIN0sL1N/UDvXNePu3rjlNnwBBj3Zg+PNff2x7BtAAF2yDk5nADlox13Af+PV9xeqHaPE8Ur0cYVOyH8ADyB12A09CGC+46rvJUsT/pESCRLX90f+wCgV0AOyzyr+W9uzryrFIc9cTnlvuH8BUeV6rBoOuCf6uvy4l1F9Hq0orxO5aCvqOHOw1ofMqDSyyudY0asJ/uo0kEZWZ4/nk9tiHleiEA9n0a47X7Ft1X4dWK+rOksy3UpmQbKdUHI/xOPmipu9i2JzwuQ4QKN9LF7Bxk9C4ZIt/D0S/wDaroOGwYQC4p6q5durtF/qHOSnRUjIv30P7J3QtXQcUYUJifdW68wKIqlAgWL4Ey3nmxQ6cxrnOinAnlIz+MxcxwSn+ixk349yYuXArra0EIRSrf2CIRCICR0eOQ1KrKPwU+BEjVv/s= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: d2383c79-ded5-46bd-f45b-08d802ebb372 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2020 09:44:22.6460 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: AvvOMcuPK7aB6jBZqitKsjaAUl4ouAS3XcZfROtfCK4nBK/Pi17v7100s532eoyACzo+O3lQZ+CunHyKfIq6HbMSDuHUI2Tz9DeE6CcvPCY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5366 Received-SPF: pass client-ip=40.107.8.134; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-VI1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 05:44:18 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, fam@euphon.net, vsementsov@virtuozzo.com, ronniesahlberg@gmail.com, codyprime@gmail.com, sw@weilnetz.de, pl@kamp.de, qemu-devel@nongnu.org, mreitz@redhat.com, stefanha@redhat.com, pbonzini@redhat.com, den@openvz.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" In case of !VDI_IS_ALLOCATED[], we do zero out the corresponding chunk of qiov. So, this should be reported as ZERO. Note that this changes visible output of "qemu-img map --output=json" and "qemu-io -c map" commands. For qemu-img map, the change is obvious: we just mark as zero what is really zero. For qemu-io it's less obvious: what was unallocated now is allocated. There is an inconsistency in understanding of unallocated regions in Qemu: backing-supporting format-drivers return 0 block-status to report go-to-backing logic for this area. Some protocol-drivers (iscsi) return 0 to report fs-unallocated-non-zero status (i.e., don't occupy space on disk, read result is undefined). BDRV_BLOCK_ALLOCATED is defined as something more close to go-to-backing logic. Still it is calculated as ZERO | DATA, so 0 from iscsi is treated as unallocated. It doesn't influence backing-chain behavior, as iscsi can't have backing file. But it does influence "qemu-io -c map". We should solve this inconsistency at some future point. Now, let's just make backing-not-supporting format drivers (vdi at this patch and vpc with the following) to behave more like backing-supporting drivers and not report 0 block-status. More over, returning ZERO status is absolutely valid thing, and again, corresponds to how the other format-drivers (backing-supporting) work. After block-status update, it never reports 0, so setting unallocated_blocks_are_zero doesn't make sense (as the only user of it is bdrv_co_block_status and it checks unallocated_blocks_are_zero only for unallocated areas). Drop it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- block/vdi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/block/vdi.c b/block/vdi.c index 2f506a01ba..c4527a9d8c 100644 --- a/block/vdi.c +++ b/block/vdi.c @@ -334,7 +334,6 @@ static int vdi_get_info(BlockDriverState *bs, BlockDriverInfo *bdi) logout("\n"); bdi->cluster_size = s->block_size; bdi->vm_state_offset = 0; - bdi->unallocated_blocks_are_zero = true; return 0; } @@ -536,7 +535,7 @@ static int coroutine_fn vdi_co_block_status(BlockDriverState *bs, *pnum = MIN(s->block_size - index_in_block, bytes); result = VDI_IS_ALLOCATED(bmap_entry); if (!result) { - return 0; + return BDRV_BLOCK_ZERO; } *map = s->header.offset_data + (uint64_t)bmap_entry * s->block_size + From patchwork Thu May 28 09:44:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 281794 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 642A6C433DF for ; Thu, 28 May 2020 09:47:32 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2C6AF208DB for ; Thu, 28 May 2020 09:47:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="YdhKv8bC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2C6AF208DB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:46658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeF8N-0005N9-Ad for qemu-devel@archiver.kernel.org; Thu, 28 May 2020 05:47:31 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37654) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeF5U-0008Ls-Mp; Thu, 28 May 2020 05:44:32 -0400 Received: from mail-eopbgr80134.outbound.protection.outlook.com ([40.107.8.134]:2978 helo=EUR04-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeF5T-0002k0-9R; Thu, 28 May 2020 05:44:32 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XzHdanKOvIoEfqCfVo/rZF9/GPaHYtOVSGt6/3lVsiXi1JFxyWUkcaTC0SKRiE2BxCY+CwvtyTzYkquENSd+Q9pXnEvrhcDE8seM2YxTxmpl4O/qvKDHaqf5i20R/eRILpaXP10kfiwoh+3Ll3jXxAuYTJ3RSfYm4JkjQIGs6GMD8jKfS6Jtt0teF666KY4TIOjbDYErl7hyNJrQG3ua6EdfaQfgkFz5hrGN+ry56Ol3f9DV4mULmooiUhVfUYkvK+w/MOB+GkIzEskf80FQAiebaC9k82HiiQKEPBiwh2TWjlW4pFfbH9LL6R9Eoulv2WLLt8/c/HSFkevzWVNMAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RHc5XfsGgm9Pnr0ydl/EGCvoHSU1aCHnH5d1IajVg+I=; b=IvhGFLEVwr6mvF561/nL6WWYYOs5uMfYRkD74aVEWxtOG+UkgDZQ2wAhB8IJCQSdH8MQUUCN6I8uk4O1Qkm6SBytCjhW6aySIgG1gez8AyWklG5LifkwZUr77AoSEFwYifKcCcs+6GAA6cWrE6McYuwrHYuuXq/R68oCa5RwE6Q3h0UVaL7DIXgfRm7/xLm3ZulodkbjZHYBruArc3/K9pAzBxo9LcEcQejybDZ94buhwQHZjp5y6mm1CHYt6SzhhSkUK6QsprHc7qRU5eD/u6J1GsBQHpwSFblSNKtt4HnJmjt4EOho6Y4/y2dKHWQt6HnVwq9HBMmhKT7AZiZsnA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=RHc5XfsGgm9Pnr0ydl/EGCvoHSU1aCHnH5d1IajVg+I=; b=YdhKv8bCrNeTqmPHNC+YsIurOnZNcuA4esQkflWRykHcXvps9QiBJsr+hPTO1cAlijx+8O+q68+5GvdJndEai6Ko6jCWy27IciE4S5j08pz5k1gN+58Doqlr3MgDnWTzgx4+B6WJ+od1bARcwpTxbz3wD70pVFnqQtJiJkXdazc= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none; nongnu.org; dmarc=none action=none header.from=virtuozzo.com; Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5366.eurprd08.prod.outlook.com (2603:10a6:20b:10b::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.17; Thu, 28 May 2020 09:44:25 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::a408:2f0f:bc6c:d312]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::a408:2f0f:bc6c:d312%4]) with mapi id 15.20.3045.018; Thu, 28 May 2020 09:44:25 +0000 From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v3 06/10] block/iscsi: drop unallocated_blocks_are_zero Date: Thu, 28 May 2020 12:44:01 +0300 Message-Id: <20200528094405.145708-7-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200528094405.145708-1-vsementsov@virtuozzo.com> References: <20200528094405.145708-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: AM3PR05CA0089.eurprd05.prod.outlook.com (2603:10a6:207:1::15) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from kvm.localdomain (185.215.60.178) by AM3PR05CA0089.eurprd05.prod.outlook.com (2603:10a6:207:1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.19 via Frontend Transport; Thu, 28 May 2020 09:44:24 +0000 X-Mailer: git-send-email 2.18.0 X-Originating-IP: [185.215.60.178] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: db9226ef-d621-415a-0786-08d802ebb565 X-MS-TrafficTypeDiagnostic: AM7PR08MB5366: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:605; X-Forefront-PRVS: 0417A3FFD2 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Mut6eXP7bTq2HUEjWdfA0isUjjeqw7QqnmSkmepTHzL/na8feVQ1UT7hN/XIhSUj8A90Aj4BUUvE4JthogvWLKTFf79aSaRkHPFhyjm0yd9q2IpEoCbHc1m+9rZYWoqHEzV5DgtFM66zABi3DADIh0bRD7YNNMUGa57lgKFbXtGhhhU9iM8AvaxXBN6G86Ag3JuCgOAvHH3ZDKLXFvKxr4NIXCzAohJ8XbuSRS6w1kwPDxPTIXQd4aZ/9Ldd1BRocZFqYTQTTzAfLwyMeaM+x6a0AlaCfZbMQZaBDlRzfb1b3GlWz3+aa1TZxuxOtRPEfhYgNXOJy4PRBO9mJRHWvA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39850400004)(366004)(136003)(346002)(376002)(396003)(2616005)(4744005)(86362001)(316002)(5660300002)(7416002)(956004)(1076003)(6916009)(66946007)(83380400001)(6666004)(66476007)(66556008)(8936002)(4326008)(6512007)(36756003)(478600001)(8676002)(26005)(186003)(16526019)(2906002)(52116002)(6486002)(6506007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: C6D2z1ldNG5zXyHh7dvWGQYgphNaLmCqde5EFmHpOA/LpA2sV5nJ2DSuVfn5lxLtYjq9tlwqgeg9tVZpfD9AC6qafBKosOXdlUeVVhQJvv6ngUhSAurwKAZ6UH9+sGcrA+UoevXUhB740vH1XRaSXRkLi1NQXvM9p8y/k3NVWbjOCCAWUEwqIsTCAu6tk2tGITSrVdGxWz8bKxhYIKxcdWUDn+J9PEsqc/enDFYC2Iy/8Oq8JKeT9IoiidXqaqLev+3u3G4x1S3r5YEGgpRJjw35k4XhCf2y4qIJSLHZuUbmRiuaJ/xKaxmDEoaAtYdeXJwkMTiILsFvmvi2Y3Y+3bqkDgZdKORc07h53tvMs6IULZaesFRSYrK/U5cylb+q1nXesT6sa1qWIZxqPnQBgYa2dGczC16FGlFnDs7WVLLzSg52bDVA6ZnUvoOlgGXzFy62YxLqDCBfmAqEKisWIb6p5wTyR94KQQ9kiaH1fZ0= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: db9226ef-d621-415a-0786-08d802ebb565 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2020 09:44:25.8709 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: oGhz7qhzZLo2UF2QwrDcJZ5gJ4v9Iu5EE8RCbqot2T0f9rTs9aKdC7d3I/6ReHKluYGOT+QAif+yPfdEQ71tFZV8JUrqDWzOSJ0mbDYtoIk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5366 Received-SPF: pass client-ip=40.107.8.134; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-VI1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 05:44:18 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, fam@euphon.net, vsementsov@virtuozzo.com, ronniesahlberg@gmail.com, codyprime@gmail.com, sw@weilnetz.de, pl@kamp.de, qemu-devel@nongnu.org, mreitz@redhat.com, stefanha@redhat.com, pbonzini@redhat.com, den@openvz.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" We set bdi->unallocated_blocks_are_zero = iscsilun->lbprz, but iscsi_co_block_status doesn't return 0 in case of iscsilun->lbprz, it returns ZERO when appropriate. So actually unallocated_blocks_are_zero is useless (it doesn't affect the only user of the field: bdrv_co_block_status()). Drop it now. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- block/iscsi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/block/iscsi.c b/block/iscsi.c index a8b76979d8..767e3e75fd 100644 --- a/block/iscsi.c +++ b/block/iscsi.c @@ -2163,7 +2163,6 @@ static int coroutine_fn iscsi_co_truncate(BlockDriverState *bs, int64_t offset, static int iscsi_get_info(BlockDriverState *bs, BlockDriverInfo *bdi) { IscsiLun *iscsilun = bs->opaque; - bdi->unallocated_blocks_are_zero = iscsilun->lbprz; bdi->cluster_size = iscsilun->cluster_size; return 0; } From patchwork Thu May 28 09:44:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Sementsov-Ogievskiy X-Patchwork-Id: 281792 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, MSGID_FROM_MTA_HEADER, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3272FC433DF for ; Thu, 28 May 2020 09:48:54 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F2D61208DB for ; Thu, 28 May 2020 09:48:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="a9FwwMs5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F2D61208DB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=virtuozzo.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:55066 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jeF9h-000148-6U for qemu-devel@archiver.kernel.org; Thu, 28 May 2020 05:48:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37678) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeF5Z-0008TY-1Z; Thu, 28 May 2020 05:44:38 -0400 Received: from mail-eopbgr80134.outbound.protection.outlook.com ([40.107.8.134]:2978 helo=EUR04-VI1-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jeF5W-0002k0-PW; Thu, 28 May 2020 05:44:36 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EAz1+pKE/lY4zyL9YOrR9vX6cAric8NPUA5oQtTLrDTDpOnF/Joh8Lx3VNajoQixA8IVXmU84Zwz/J7uP0d77te4+95n4aDjH2ry+J0AMS06jVQt4Qn9P7OWCbU6clJOrS7GsGe84wINySAutInK5F6QR3by+i0c4xPdsJNzevRD/D+WgJDV7j+cLd5/wlWvGg8AHM/fUiivh7SfkIS4RSGsDqMWYjT412YJW5JcypxFF/jIkNZ2psyDPrYL0gWohl7XKUdwcVwp2Zg287PYEbPnrl3Q8kVh4uhbsx45y4RglQwLqmgGi116wC+8wwdw3BEE+hdL7DpulnH3JYqQ1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sRnHMeD2MW2hH0F3F96FcK8yHt50+xxCKvFJzvOyi8I=; b=aRnqYUn0jPY8vS5Zkjp/87ZoAlIl+s/DV85knfpVV9/Qn1Qs+QRqW3aq9kEQD2NTK1CRDFsPBvvhZamooZlWcrj6F49b4MFlGOZhgefu5kuThSmxtqHsmf4N9gnrZWCQFIWdYJMGHxiy4Ni5a9pmnqGFRv2b5GqvF0FO9gi1o2oLyngKkZjPTClxRTZJgUoHYPcuVA5botp0QVAS2UtRjcBICzUFhT0a6G8Abm6TpwbKNmb/qrAEnmqMp7i89Xug0UmLqvjaHZMVlKlLXe7zO1fdli+UWlHTit2m+e1H60Eu2fUgvz0XuHeTRfI01rUJiNQY2leaomEqA1G6f+Aa4A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=virtuozzo.com; dmarc=pass action=none header.from=virtuozzo.com; dkim=pass header.d=virtuozzo.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=sRnHMeD2MW2hH0F3F96FcK8yHt50+xxCKvFJzvOyi8I=; b=a9FwwMs565M011cjy0iIETFPoOXmOrStfR3g2Et8m8V0zgOXqIUJuHAmjrukhbnaFstMcceU5s+WGpg/IxaFwgsEvk8QDVQulo4qyoTAw/Vj6oivXDbEU3X7baiKBnNNF9rzF5LElcD5wkxB3Og0JHD59AWMG5dq0Ek2vmVcGNo= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none; nongnu.org; dmarc=none action=none header.from=virtuozzo.com; Received: from AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) by AM7PR08MB5366.eurprd08.prod.outlook.com (2603:10a6:20b:10b::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.17; Thu, 28 May 2020 09:44:28 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::a408:2f0f:bc6c:d312]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::a408:2f0f:bc6c:d312%4]) with mapi id 15.20.3045.018; Thu, 28 May 2020 09:44:28 +0000 From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH v3 08/10] block/vhdx: drop unallocated_blocks_are_zero Date: Thu, 28 May 2020 12:44:03 +0300 Message-Id: <20200528094405.145708-9-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200528094405.145708-1-vsementsov@virtuozzo.com> References: <20200528094405.145708-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: AM3PR05CA0089.eurprd05.prod.outlook.com (2603:10a6:207:1::15) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from kvm.localdomain (185.215.60.178) by AM3PR05CA0089.eurprd05.prod.outlook.com (2603:10a6:207:1::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3045.19 via Frontend Transport; Thu, 28 May 2020 09:44:27 +0000 X-Mailer: git-send-email 2.18.0 X-Originating-IP: [185.215.60.178] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1ac82830-3999-4962-1104-08d802ebb6b0 X-MS-TrafficTypeDiagnostic: AM7PR08MB5366: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:85; X-Forefront-PRVS: 0417A3FFD2 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CBcXqhD4gp0s88nBJ213dsrB8Jg8AXozmMGA+WoYeBbxwjQ7fIeShGA9LBFIGZrHH7p2vbj78zYqodPhqek+yp+MCodh72ox9ay98qTfOu5ES8V+sg2USOObZlKg7/BXIMT7kUspe2YjWN/pNqEkPTIUzXXONDGWr5jLKUquEabhMcCogvwe32/fJX90pjzK1VCnWC77RYpDd9Uz4iXhKy6LJQyEeHfUD0VJ3KVpLXTvNBEJwGxJDPTNL8wqeYNzECb4QcR0u8qF305CiTteDXiG50keQTKJUJ9+4DDzsVfAjh13K08lGpC3DviEA6Q5wbGVpgthuTJz5wOUJcL0cA== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM7PR08MB5494.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(39850400004)(366004)(136003)(346002)(376002)(396003)(2616005)(4744005)(86362001)(316002)(5660300002)(7416002)(956004)(1076003)(6916009)(66946007)(83380400001)(6666004)(66476007)(66556008)(8936002)(4326008)(6512007)(36756003)(478600001)(8676002)(26005)(186003)(16526019)(2906002)(52116002)(6486002)(6506007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: Wo8T3eoYz3uYY4m+ScIvNZsAKvEpa2ADBLJ2HAWRBKhWknqU7vsn70iJZcql1Q4n6dg+LfwTEvglCUCcpDT8b4giR8HEwoNK7CpBcIaO7Z6BPc9F4k2oijmd6c12HLmWD6HJGB3bbTIQJckBCmkWtktMP/dZ1L8DxQE7zVFwL/a/PH0iTcPr+gOeBfUdJM5ybfR3UO/N82sLt6lLAeYYlQaP/PEf/JswIahwMN5mHih2Zt2Ko0h9gRjj943MctKzhF5zz2zbr0IylyoJBZLQdIbjrUmXCKM/5NjkxEOXm2ZKo/vvKnVCG67FYxb8Iwv7jNh7Rl1PQN4jfaiS5foQihg3jVvBIefpVw7HgJKyEQGQV/Xu9ZzMuJZxvfWmHgQV41f7HBNaIbbeZLQeDdWSD3a8kokJGQhKr5RuhMDXTd6BDN6mR/IEsVhZ78pxxLoajw3xXVsLGpB0dAXLiOyC9tEwdPV4E+vTQbhZl810GYg= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1ac82830-3999-4962-1104-08d802ebb6b0 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2020 09:44:28.0244 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: aJ6NWCrXM6iryhMCvPrUfKi8kars33rCzNC87DsP/R8ajp+/QWOys8ba5r1MFTpWxAIFJ8L9Rkwyx5zwP1T5bPkD2rimxGx8PnUrzMPifNs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5366 Received-SPF: pass client-ip=40.107.8.134; envelope-from=vsementsov@virtuozzo.com; helo=EUR04-VI1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/28 05:44:18 X-ACL-Warn: Detected OS = Windows NT kernel [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, MSGID_FROM_MTA_HEADER=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kwolf@redhat.com, fam@euphon.net, vsementsov@virtuozzo.com, ronniesahlberg@gmail.com, codyprime@gmail.com, sw@weilnetz.de, pl@kamp.de, qemu-devel@nongnu.org, mreitz@redhat.com, stefanha@redhat.com, pbonzini@redhat.com, den@openvz.org Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" vhdx doesn't have .bdrv_co_block_status handler, so DATA|ALLOCATED is always assumed for it in bdrv_co_block_status(). unallocated_blocks_are_zero is useless (it doesn't affect the only user of the field: bdrv_co_block_status()), drop it. Signed-off-by: Vladimir Sementsov-Ogievskiy Reviewed-by: Eric Blake --- block/vhdx.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/block/vhdx.c b/block/vhdx.c index fa9e544a5e..645dc4b4f4 100644 --- a/block/vhdx.c +++ b/block/vhdx.c @@ -1164,9 +1164,6 @@ static int vhdx_get_info(BlockDriverState *bs, BlockDriverInfo *bdi) bdi->cluster_size = s->block_size; - bdi->unallocated_blocks_are_zero = - (s->params.data_bits & VHDX_PARAMS_HAS_PARENT) == 0; - return 0; }