From patchwork Wed May 6 09:25:09 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: 283322 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, 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 7967AC28CBC for ; Wed, 6 May 2020 09:28:37 +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 43E7C206DB for ; Wed, 6 May 2020 09:28:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="uNBsaVeH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 43E7C206DB 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]:55644 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWGM0-0003kX-Dc for qemu-devel@archiver.kernel.org; Wed, 06 May 2020 05:28:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48942) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWGJU-0007sJ-2U; Wed, 06 May 2020 05:26:00 -0400 Received: from mail-eopbgr20115.outbound.protection.outlook.com ([40.107.2.115]:7399 helo=EUR02-VE1-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 1jWGJT-0006M8-52; Wed, 06 May 2020 05:25:59 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TS34xdh6r98S+zWpYwym2m8QrI3uJKxysaE320IJA40R72sOfiQ5kw5TPIch+bExJ2pCfkSfeEB3yxTYn6HjYSYz1wcItvjMwOOmDJesTdrNeJXKKq5RT3jZRIbCXAdTTqERUI/aPOiZX8ENE0JBkwUQn1uZBc3qLRjZ6KdoJfXHFPD6qhHxSdbqoncU0spemZ3C4nKiZ2Aacq1zDDND5k3jPq6/Kn9VBQaMvaOFe8meu1JOYM6rpkvq+UzKsZZQGGfVyUGjU84nmiRrlxIMMCer8NfLQ3SsCewz2LL604Q8fmP++KjAgMN4gQ0JnI6jBkMeEgCuezlRG6i4a8fmHA== 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=UhwpC8Q4GWHznTsW8gfNCsFiPmsjmwh67BhMgluksDA=; b=ZTFD+gxP/ycTK/Sg1s9g+hGZTV5JxAJaXFZYdM96AIz2p35MhUHp6BbMptYJQpPn9bb1NTnUe/XytZHChNRUUCAbAbj2rm9BgKUZIsuUunKabiwgVrrF6+oeTQOGuvh+IbnPLB3Z9ZKtgaXKBQSPZVCJe5NHo+nTR7FUr0apbOJwHb1Mq2DCoh+YFwC5zznKpFW+B1w6Y4/qzkiVvPfpo1k6vjgaCkhFnHtbAk1fdomyajlKhjyvb+B//f0BzQ69YzsquWHyUudTt+ae0niorFawaoCmw+6nBHylCBSuU57W/ee8v8upwEdm87u3y232DCwEWcqtThSkmoY+Olql8g== 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=UhwpC8Q4GWHznTsW8gfNCsFiPmsjmwh67BhMgluksDA=; b=uNBsaVeH77s4OoB2NwvNuRj6NEDoMXxk2NoxR4GACLw8jQ5ykeeZfrGMemyVYqpqrQcgy7245q9rKH8NBX9/WxMa9BjMKFcAgakrcbQ9gY3l8Dom7r4o2Uxd+/QsjdnJx5Z1Qkk610q+LTSplr/yp7pgMqMIefoRyYo9AJUSqCM= 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 AM7PR08MB5382.eurprd08.prod.outlook.com (2603:10a6:20b:108::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28; Wed, 6 May 2020 09:25:51 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9%3]) with mapi id 15.20.2958.030; Wed, 6 May 2020 09:25:51 +0000 From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH 4/8] block/iscsi: drop unallocated_blocks_are_zero Date: Wed, 6 May 2020 12:25:09 +0300 Message-Id: <20200506092513.20904-5-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200506092513.20904-1-vsementsov@virtuozzo.com> References: <20200506092513.20904-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: FRYP281CA0017.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10::27) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (185.215.60.178) by FRYP281CA0017.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26 via Frontend Transport; Wed, 6 May 2020 09:25:50 +0000 X-Mailer: git-send-email 2.21.0 X-Originating-IP: [185.215.60.178] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 34b7a7be-9f14-49ff-f0fd-08d7f19f77db X-MS-TrafficTypeDiagnostic: AM7PR08MB5382: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:262; X-Forefront-PRVS: 03950F25EC X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: M9uv+C/hxoBjoOWDk0Aqn/I/mJ8UtYyTk3eXJNowbAKb6tOzVPETJTxSlAt9xUQc2bG0Dnk8zcHR/hNKfr1j1ODt2tjS9DfeqvzwCsBipAqQrlCwL/p+ax1nU2VzgNS1Mx9sqik6UOgXnfQn64Q11xCbAIGiqZw2lscdZOz/I5v9/BZ4oGxF7jFKaYJ7hnZ385CAP19BOzil6w4tEPgkgFDqp/Lvw2umVOooi6+1QBKiRglq+oviXqiPzIqbWE/OZzKhuv4iDbk4Nc3jV3k1/fYPx4gaxHTylfzA4EM9cqhejBSNeS6u3DOX1MzwtcSCIRJwBx87rRQkujgjGWzvPsh2NAAzH8dHhFuKKBm9de8IvxhLBXczqGNp+Lmy2B9cZfnvtkk0Qy3H6FxytFcC4hoInJiM8onCjTgEkCJ/8AON+Ir4nwGnKEfpghTuRpNzUUHbFPZe1rUXyPs1deqr1Jj6DMxFUBZDW0UmH+0I/Nt+HhIYTCsIGUSbHI2wA8V2hsQXtuXUUzO4pND0WE0zSdOEsxJQPxpGpwINF2FsgJfrgRpntIXFIMxWpAFbByKn 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)(376002)(366004)(136003)(396003)(39840400004)(346002)(33430700001)(6486002)(6916009)(52116002)(956004)(2616005)(6666004)(8936002)(86362001)(26005)(107886003)(2906002)(6506007)(5660300002)(36756003)(478600001)(16526019)(7416002)(69590400007)(186003)(66946007)(66476007)(33440700001)(66556008)(4326008)(4744005)(316002)(1076003)(8676002)(6512007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: KDGJiKbHyjYm5y/LRTaASqVeKv31jKMxfzPBolVdwyCJc42wFeNBiR0E8MdnMIBdQ0N4jKeMB4/iwzdzmVX80fa65paz1guwuJ77PMTY3QmaeoOOE7Vgu73gPpsEDijnldahXmfiRJyUbsO8HAo/cHF8DCrZT0LC49/oLZ6UVT1jPKQ0Xx/Tg8ASrDgvslLluOaZpha/f+ymptiJn3XCXj4CaphIP6JPFNtM8+/FY9GewFt0Um4EKlvCskSE8ci6NXM73U8EHmKxGoRQInbNgBkLoZjyB7iWgGaItP828Z0RsQG9mTEpP99R3SIs7DwdNyJgvmwCc240A4R1GQ9D19Fq0MQOX/qXhJrb9iLdXCckaYrXR40HsHKkRMYdLmANAsxD7JYlyhFPXNwPgTrVOP+9MVL7Y3sKwR+/5VNQXnrRqjPDSJ9MNapyY7E98sZODz86tI6N7e4Opas0DaZqcj8YCOxKoZ27mE+ECT4YHYrmDwLHy54f2IuK+SxCfk57f/CUevEz5rVHlRD9XIZlSoItgwDmZeVMvz2cjPFErlP52U2CswbP3Ozl78emmsamCUp8Q4OHoVHOLlhCdREhvNGASAzhl07bb6K2Zwlyfj0MBdMREDd+/zi0sorXOM9gmfNtRjLoHwsyzoWybawiicOq0pPnHMiNu3WT9CYIl64CjnMQApTt+1k/2W6fIz5MaCYG+Cc1lO/pjTJuJLtp2aM3DIfDE8R3j1/EMUOYWXF/wV0RxlRcw32u37kpg/+MJLwz0EBHLKlFDW/FFGCRsN4Jn1ACZkCcMI+0iDPK08Y= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 34b7a7be-9f14-49ff-f0fd-08d7f19f77db X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2020 09:25:51.0336 (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: SqGzsvmsTI6heQdCtyC1FIC5aQQEz5hjns2G7UwpUBiBav0PXQe1I5PpvjKXedXW+j4Bp8Sg6Uz/33J9zRSkOYG62W5Tm7CLy3dXzx6s65A= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5382 Received-SPF: pass client-ip=40.107.2.115; envelope-from=vsementsov@virtuozzo.com; helo=EUR02-VE1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/06 05:25:49 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: fam@euphon.net, kwolf@redhat.com, vsementsov@virtuozzo.com, stefanha@redhat.com, codyprime@gmail.com, sw@weilnetz.de, pl@kamp.de, qemu-devel@nongnu.org, mreitz@redhat.com, ronniesahlberg@gmail.com, den@openvz.org, pbonzini@redhat.com 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. Drop it now. Signed-off-by: Vladimir Sementsov-Ogievskiy --- 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 Wed May 6 09:25:10 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: 283323 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, 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 B7686C28CBC for ; Wed, 6 May 2020 09:27:28 +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 815D6206DB for ; Wed, 6 May 2020 09:27:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="vel/Kzk6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 815D6206DB 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]:51164 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWGKt-0001vt-Mm for qemu-devel@archiver.kernel.org; Wed, 06 May 2020 05:27:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48964) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWGJV-0007wJ-Di; Wed, 06 May 2020 05:26:01 -0400 Received: from mail-eopbgr20115.outbound.protection.outlook.com ([40.107.2.115]:7399 helo=EUR02-VE1-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 1jWGJU-0006M8-KH; Wed, 06 May 2020 05:26:01 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Kmkq3XLD5iZCUVTi/8h8HG7BF5mbR7lmtJPq137K5xvUYvBXheCabOJd2cHqaB++THVUu99F92D06HLafk2sGyZ8Jaua/7ApJQaLEOfB2Bk3rkt9H0Ag4WmZLreuehc2Vab9j/cuuwsvyUZdxEGS0R4RzLgyIZUkc3Z3qnl8mbbLNWEXFM7EfL4Z24j/Pti6Zai7vu5WCFLEMh3gw8IOI2HlF0XRmU81G6hpzlDwBHKksqMZ5w3VadJVPsNJ+r3u+M+6tRKvIBmDqZbpPbwrKcGSM85jypxKgWjeHCpC72PPb6mAWcsXubIzNNJeDahBg4qJxnZ5WN70HefF7oHSbw== 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=Qd8IHOGIPLUQSjIyBtnjHX/hsBMDt6lUuP3Mm3kWzt4=; b=IEWGVcdDIesr7SlmGzdZ7N0uqXOs7W7l7nEOECDztma4FlNy/kp5MSs7tbOQZ9BMNW4cUoueRh8VofpKLDlSB2xL1HYBWQ1OzPuFhXUjP4la+ySzrUD7/RCaNmDS5nIlvytTzDchKC/DivOa+s4aGflcQ8+VGuCZnxBCkai1G3DpZwGih4O0SCIusNy/YqhTO9JTYC2+OXciskfzUPOE2fIGbEy9xXzv7lAcpuhkSEZhlgKbXqmIQAVjWbcyZu/wFgegyoxzF9JcHKnlKwFV+Zy9h8/kqS0jpGvDMDfQeMTLos8ycnrByzHk81J7El53zPCMI6CSuYr1K0w2PGgwyA== 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=Qd8IHOGIPLUQSjIyBtnjHX/hsBMDt6lUuP3Mm3kWzt4=; b=vel/Kzk6YJWchVWIoT3Ku5OKrk4UsMG5brcuvmQX2GKtWBi81EgwgodVASQHpcbX1B5PhYEQPrLfo7nl10woBUb1JKw5zpuOpNQ8Ew9v8oEjXd4saDan8XybNMXAI/2rIgcsSI3zHigM81o6IL/6XtFJzUPO0H4nSAt77sffxoY= 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 AM7PR08MB5382.eurprd08.prod.outlook.com (2603:10a6:20b:108::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28; Wed, 6 May 2020 09:25:52 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9%3]) with mapi id 15.20.2958.030; Wed, 6 May 2020 09:25:52 +0000 From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH 5/8] block/file-posix: drop unallocated_blocks_are_zero Date: Wed, 6 May 2020 12:25:10 +0300 Message-Id: <20200506092513.20904-6-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200506092513.20904-1-vsementsov@virtuozzo.com> References: <20200506092513.20904-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: FRYP281CA0017.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10::27) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (185.215.60.178) by FRYP281CA0017.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26 via Frontend Transport; Wed, 6 May 2020 09:25:51 +0000 X-Mailer: git-send-email 2.21.0 X-Originating-IP: [185.215.60.178] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 2f04c9ee-09c2-4e53-e5e7-08d7f19f786a X-MS-TrafficTypeDiagnostic: AM7PR08MB5382: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:40; X-Forefront-PRVS: 03950F25EC X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: hHlc8O7JMFZsjsgWEHihyMxpAQVocmZq49pH+MCw46KejgDdFZftRZr6CK15frV/FDJTQDg/peSh8ZyTmlk/FnZoI/MnnLWE8NzWi4/rlW2y6t6C0GB9Xs7W6mcLOFrlQINj4IqDuCFe5xkNROc7TQSUjbvAn/WGDDLQac4D2m6iQQrMOlUHds1bK6B0gKabhNzt47hhFuhmVHQWv8MVfAC5hkVPR9T6uKb3yfC2mhOZRgqCNnMqVUWEYZcBfo7v6DFaqjWc8DqLyd+fBZPbZDjgghNdjqKTyUvH+ymvn4k4g09p58CMIvirALo0T5qdOOXsoxKqr6hMCYzpLg20PeAjTHxln42NrW0VFM1QbVkox8EGZI/uRzIYGEJsq97RLXT/e4MV/7b8laObyCMD9/OKEYL9dHqXTO/i1CNeq/K4Ot8iVyNCWTS1E1hJYeg0nKcjRy4cdHkOwb+SI2j4KntBfpkYlSmgUQFwN7XLRltYfHnM9khA8Rq0qHExACsqMeDk3NqBIIekX0rjjDYIZjYHiv0p5tsqDsw+yx0U3Qlm+9PcvqQ9UuWaEVvpGjsl 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)(376002)(366004)(136003)(396003)(39840400004)(346002)(33430700001)(6486002)(6916009)(52116002)(956004)(2616005)(6666004)(8936002)(86362001)(26005)(107886003)(2906002)(6506007)(5660300002)(36756003)(478600001)(16526019)(7416002)(69590400007)(186003)(66946007)(66476007)(33440700001)(66556008)(4326008)(4744005)(316002)(1076003)(8676002)(6512007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: aYJumq/lTqh3G6Z1bw2hN7ONYkfRHXNfvNpqrxTssW5rra19ksCmLWTgsgNE5oWNaCf5JPDlxofjMzIlEcNNj17OR/AL5lARNp2+K9rdhf4oUEf2gn/QmP2CAHuEsdjcCgKSsIaEverefcqIm86qrb0UNLEnQUTEXWAA9htb70ttPUJ+Q2XA7puS/BO2WiWxCYK3+2ZNxRaO+kR2b1aCfgI6VtzrU4PAVVvOxoxsLyxa0Ene/X1VkoWW09lSD83dOIQ0LBWR2MDDZg0cNl9ps/Igk7mtB3KFGxQdEYT6QQ/LBN4Ag8CONxsQVTi3LczuSK299uN7bvqnbKQ34Xcn3z1mtAia6XAzl2IGQgbij4JmdVSR/PR7W9pI6iuyVzuhaSERDrsqS5AmdzRm76hQBbqXPNxB9vuZadURHU4tNltgLWXda1vB9cF65JVqUIsIwQNfTfVCERGS5vu1d7giCX6ZEZ00CyYAeQzZfrxYJ1DBssG9BuGrjsvxoUmUa8yV1Aa3WSebu77edVQTnlu4SX7ndYsJ4/XoqBOJ2+oCEadI7dugt0vjr6GkMZ4Qwgeg3LUnlCah2/meXBFNng0DXAcA8p9TAAVJa4WfjOrbUo/MIAh9n1cOat4XO4hGJNyzPABqTo9MdnhHANHWrc1h/MKfFhD8T6BD+1c0/E8vmUuBtYtWAZT1rbOuZxLtx9wNTJo+IoxYcEij6ZVXFhFfUJoeuvRYhIL0bE07FAimxiuVXJ7HsQREhzK4n0cgrmmf6VUYPXzdiJIwI60/1DlRWfUftqBhaB87ObfTbljxRV8= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2f04c9ee-09c2-4e53-e5e7-08d7f19f786a X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2020 09:25:52.2960 (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: PXyYuuj5/kYuJ3CSulUPm6oX2QGLto8Ag4U2kDL1eZmZrCkI4FJ/VkzoL92MVzTsavAuP12O2R60X22RMe1j4pBumyDOhMAZOJ10e03GFl8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5382 Received-SPF: pass client-ip=40.107.2.115; envelope-from=vsementsov@virtuozzo.com; helo=EUR02-VE1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/06 05:25:49 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: fam@euphon.net, kwolf@redhat.com, vsementsov@virtuozzo.com, stefanha@redhat.com, codyprime@gmail.com, sw@weilnetz.de, pl@kamp.de, qemu-devel@nongnu.org, mreitz@redhat.com, ronniesahlberg@gmail.com, den@openvz.org, pbonzini@redhat.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" raw_co_block_status() in block/file-posix.c never returns 0, so unallocated_blocks_are_zero is useless. Drop it. Signed-off-by: Vladimir Sementsov-Ogievskiy --- block/file-posix.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/block/file-posix.c b/block/file-posix.c index 05e094be29..5c01735108 100644 --- a/block/file-posix.c +++ b/block/file-posix.c @@ -2878,9 +2878,6 @@ static int coroutine_fn raw_co_pwrite_zeroes( static int raw_get_info(BlockDriverState *bs, BlockDriverInfo *bdi) { - BDRVRawState *s = bs->opaque; - - bdi->unallocated_blocks_are_zero = s->discard_zeroes; return 0; } From patchwork Wed May 6 09:25:12 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: 283320 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 30AF2C28CBC for ; Wed, 6 May 2020 09:32:37 +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 EEF1C2073A for ; Wed, 6 May 2020 09:32:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="XeFYZ+I7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EEF1C2073A 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]:39100 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWGPs-0000Gn-3j for qemu-devel@archiver.kernel.org; Wed, 06 May 2020 05:32:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49002) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWGJY-00084I-By; Wed, 06 May 2020 05:26:04 -0400 Received: from mail-eopbgr20115.outbound.protection.outlook.com ([40.107.2.115]:7399 helo=EUR02-VE1-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 1jWGJX-0006M8-FW; Wed, 06 May 2020 05:26:04 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jT6WRngp3eneJ6gGGPwJGOBzwXorQG5TpHibf4qAGLZ1v2CmJgZDvmD4MgCXPAEOAErxsaSofIi6ENOdiRZw/45/bsHdgAWBNNa5+gwdwIIGsR6Y5SOn0d51rvoYTWiVU3PNzRXNqIXfJrXZ+sIvaCTMocHaue83BERQD2M8d5eMjGX9S+FE2g2OX5k2e2+koltYiLKlvU4XWkmg+q0ftxPruhZKLbXlEH2YHI5d990ObFqYbfo8fu1jyU8eks5CzJOPVAE5qwx4sXUN/TPUCf0VchprC8w1V3Mu3BDVuWEtWLCwFWEbVy11CRn2/0C3DRNCQM7+VEvRCCWAwJ2bdw== 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=j/tYIj7mrdIsX4tg3tsG17MNhFv9OGlRKqf7KQyYDUo=; b=JDFtQFbxMtzWebWTpa8ziJEUE3PupLWo0vX1gI5+L6iyzK2DU0MEloPDRPJC9eC46eE+f1POk0DoZrlsJk3z5veUmTNpHhemOcJLyjSZakMhs8J9BsqinO0ottC2hjQerE/SnQcZZlWAD+SwrKQAmFkxQ44JihYU0mKnPYLFJ0ThcJ0YA01IiyMNEpJO4gW7mHePXgUZOMe56U5fuujTR/6TW7Bm4SR41YkB+9+J5BxIdr3DiW9UTJ45xGw8xszIHhkLJ1rhbwTdJCibyCP44kqjOX1IDHjQXykkjKvJFBf1kZCs4Ae3oC2HoqEGeOF7lz14WzZyQb771ucnAGw4wQ== 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=j/tYIj7mrdIsX4tg3tsG17MNhFv9OGlRKqf7KQyYDUo=; b=XeFYZ+I7bcYSpf27/cHDtq9IGNmM61U9yAs9EVqhwXqypGf841JmaaVaaxYrkmZX5JOfYAlkEIXn+Bei7ieJb7lUROrneg8i05JfD21zzC0i4a1oHrMX51fqjj8SL+3ropmCuWRfVAGf+rzwr44PXinuaEo7QdAKm7XZmD1RWMs= 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 AM7PR08MB5382.eurprd08.prod.outlook.com (2603:10a6:20b:108::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28; Wed, 6 May 2020 09:25:54 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9%3]) with mapi id 15.20.2958.030; Wed, 6 May 2020 09:25:54 +0000 From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH 7/8] qemu-img: convert: don't use unallocated_blocks_are_zero Date: Wed, 6 May 2020 12:25:12 +0300 Message-Id: <20200506092513.20904-8-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200506092513.20904-1-vsementsov@virtuozzo.com> References: <20200506092513.20904-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: FRYP281CA0017.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10::27) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (185.215.60.178) by FRYP281CA0017.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26 via Frontend Transport; Wed, 6 May 2020 09:25:53 +0000 X-Mailer: git-send-email 2.21.0 X-Originating-IP: [185.215.60.178] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d6ccb276-d45b-4dc8-208c-08d7f19f79dd X-MS-TrafficTypeDiagnostic: AM7PR08MB5382: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:262; X-Forefront-PRVS: 03950F25EC X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: mTczkqlTnRO/3aFehiYkkHg1oc8zx+sZ5OhwcxJ5bXJpvwbSMj+HP33jXzuiKopAaEhwKVQM/NzPHk8DM0zfKH9/2eOV8E7EqHb6SUmiIG/frMLznDrrNHQmwhcdeqgsbveiYogjvQM7AzCv74JFlhtvgp7AO2H2R5qg/6VR7nRTy3t5/sKn8GMPD7M0acxyb1Z9DcvS/kLRl4behIoTSvCQG0EqRI4KTuOxJXW8GEarAY1qfp/aqHj6RR7EE9MIyh0mSM3XFfj9QQMV84Vrztr/BbAYdJeocruScR782w+ll68knpCrkOjWtuKtU6dk3zQ+2w/O+kW00GMg9LtwaizpqdUOztUzQVYamX1C7GMV/Nox/BXTLEWnhlVy95AF/ufOtfjYCd0xTjRz0bX9f65Q3Qds8VpoCcqw69RE6cxG3pC+bUYZE+E+USXHvpufKWIoZWyyI5W7xvFFAu7CFk8PS+zNVUWmZcvfm/xNh4gCm+RRofb6aL4qFS7Dle4qrEKD3NqDU/2zkw9Lkp/f/BrOhD1jDV6WqPw+0QUWxDZRF2ljK5a5mrh6sWlaATWE 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)(376002)(366004)(136003)(396003)(39840400004)(346002)(33430700001)(6486002)(6916009)(52116002)(956004)(2616005)(6666004)(8936002)(86362001)(26005)(107886003)(2906002)(6506007)(5660300002)(36756003)(478600001)(16526019)(7416002)(69590400007)(186003)(66946007)(66476007)(33440700001)(66556008)(4326008)(316002)(1076003)(8676002)(6512007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: CLzkhb8/W01Atsp5/gsS8hnXRvvDGa5kHCYO/jYkRIvTCapJn+2qxZRcby4yo+a0k2ysZrZZxvDR+QC+eYu0RljHpO6UII0us9rU87G6NEmf/T2vGCIGaYHnhNjxqD/6bOMITo4XRQutp3OaVT2ovRfGS+kJyIrwzC8ssXLybbJHtCzHhTLT1BaAHmUQ5TWyAGX8Qay61rHrrK+vG9nsDSyHzvAYUsQ1K/O2TnTAku/DDb+WHHjWb2oO06Xy9wNa2qB0zne1xcAzdXLFMV5cI8NIWu2993TIPZaBz7sXVPy3j7GqXtf+IGZYOYhtE8jQrln2sibd2ta7g8doqzjtpFH82hcR+R69vynb4UvTyL+fSiEqWMyC8mgxHRyJxAbYwv/qzwl5o/LUp0tcH0AnvXduFE5jkdTXPMt1GNyTRDAiRiDuIHLK01nP4vL8s87VrWZ5Z8CDcA2P7rU9Up55pL20oG3f0OR+mtEa26+gEnZvKDLzhauIGoXYQhLcO5oPi12HNGYU4B72mntM5h/nFslHCilb4Yk/h8kjN1AL8Y/aXZ54ZSqsLP0ZZ5SD3rTjg9sbfVTb31PfsRXM/3P2h5PuuzGLOzhU+vWK/FyZaVb+QXnjeKFt7ItLeo+MzJuwA5YtnLRNvMaGrK1NfkXfWOMRJ8RT+4nQ9/rP+fg1rYHH9IhKgvWZ0sOkJAnmkplkqfr/XYmKvnEVcCPueudxbbtu4xRJF15K/Wlz9G2WCGas7GO0bJzkh4Zn/VY5G/uybziKmjgk8UJwmW8J9OWtYVXw21wUfw7II9JMA8p8V1I= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: d6ccb276-d45b-4dc8-208c-08d7f19f79dd X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2020 09:25:54.4884 (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: pYqVYoTQCH+1YRr9kkvmzs5cJqM0zo0O/ku8mj9cS34NpnOLvTb2yf24nbQQdswAya9sbwdNrEfdZoN1LdsL7CN1/x8Bsa25ZRzy1CBnK9E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5382 Received-SPF: pass client-ip=40.107.2.115; envelope-from=vsementsov@virtuozzo.com; helo=EUR02-VE1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/06 05:25:49 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: fam@euphon.net, kwolf@redhat.com, vsementsov@virtuozzo.com, stefanha@redhat.com, codyprime@gmail.com, sw@weilnetz.de, pl@kamp.de, qemu-devel@nongnu.org, mreitz@redhat.com, ronniesahlberg@gmail.com, den@openvz.org, pbonzini@redhat.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" qemu-img convert wants to distinguish ZERO which comes from short backing files. unallocated_blocks_are_zero field of bdi is unrelated: space after EOF is always considered to be zero anyway. So, just make post_backing_zero true in case of short backing file. Signed-off-by: Vladimir Sementsov-Ogievskiy --- qemu-img.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 6a4327aaba..4fe751878b 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -1632,7 +1632,6 @@ typedef struct ImgConvertState { BlockBackend *target; bool has_zero_init; bool compressed; - bool unallocated_blocks_are_zero; bool target_is_new; bool target_has_backing; int64_t target_backing_sectors; /* negative if unknown */ @@ -1677,7 +1676,7 @@ static int convert_iteration_sectors(ImgConvertState *s, int64_t sector_num) if (s->target_backing_sectors >= 0) { if (sector_num >= s->target_backing_sectors) { - post_backing_zero = s->unallocated_blocks_are_zero; + post_backing_zero = true; } else if (sector_num + n > s->target_backing_sectors) { /* Split requests around target_backing_sectors (because * starting from there, zeros are handled differently) */ @@ -2580,7 +2579,6 @@ static int img_convert(int argc, char **argv) } else { s.compressed = s.compressed || bdi.needs_compressed_writes; s.cluster_sectors = bdi.cluster_size / BDRV_SECTOR_SIZE; - s.unallocated_blocks_are_zero = bdi.unallocated_blocks_are_zero; } ret = convert_do_copy(&s); From patchwork Wed May 6 09:25:13 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: 283321 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, 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 55208C28CBC for ; Wed, 6 May 2020 09:30:18 +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 0C8F92073A for ; Wed, 6 May 2020 09:30:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="IUOTh1QU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0C8F92073A 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]:33140 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jWGNd-000691-36 for qemu-devel@archiver.kernel.org; Wed, 06 May 2020 05:30:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49020) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jWGJa-000892-8u; Wed, 06 May 2020 05:26:06 -0400 Received: from mail-eopbgr20115.outbound.protection.outlook.com ([40.107.2.115]:7399 helo=EUR02-VE1-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 1jWGJZ-0006M8-0b; Wed, 06 May 2020 05:26:05 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=de93ioL1iD7MtlIfJ7z0GBIfhXObPHEcimW5qh5MvUG9h0mTkJ6ciJ9rAG5KV1eExlGQhwqIxUN//mL7ZFi8ZgSPT34tapkfTtzaypb3luWWNhbhdXUy3KDfFNjoRUT+PaqnSVzQws2rJif/SWuLyevYJgWqCdokaF8cKehZ66S2gkOAVOko3gxxUNhg9valVpDQwSmZYGdYXKPHdE9QRM6e1ZV11FIanlfB+3lhaiY+MRZED1oosD1M5nOqA9cc/Mx+mg78hkegsOYknSctKN6Po5ScVsTJS1SBWWZ7tyGj1+ryTaqQIITl3ug2WhyduycOpO/2/SoCvBBGgGne8g== 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=2CJ/zA8nPmGcJLhw0yj8M9+rqqBa0WbBpGW0h7FaeTk=; b=AryYtzo840xFzWrZgmH6f9NSHw84RbvShkyhGqDMLHf+lLke3FUcT7vva6msFvbjoJ12kbEA/3hVmGCju6oBBYCqxt2S+OhR4e/ECUCg3w9m40ODV0biQGyWjeC2TJM2xHaJq2qX36OZuf8QmAVkelSnp2z+28De9o1MUEMKLyeIjXwratg3z2GVGJOwQfiWeIMuE7L+U1Z4RJQLWvVxl86YYitLAeWGGdiRLFgGEHw6Pox3/oYFEurWFqiIkWYgcV/W/Rd1h1bGcE9ulelfjgsdbEMuVDDywwGv7/OvEFkzTWj1EYTMMT1uv7Y5aHJhmDYpr3DAemMaCEJKUOF+DQ== 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=2CJ/zA8nPmGcJLhw0yj8M9+rqqBa0WbBpGW0h7FaeTk=; b=IUOTh1QU1soPPjqIaHsaRvSBJdQaBkjdcYxEyKcWPgSilpVsm0DhLkmMRfPjqodK0jOUrzOnDFFO0z+xVFQsTiOdYqC/HTzUzTNc8fSKcOY+l5nerJYUE9CqmNSNdYHyLsoTM64k6pYCZmW6msHgaNWBMTK5ZIPpatoXTHSExEs= 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 AM7PR08MB5382.eurprd08.prod.outlook.com (2603:10a6:20b:108::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.28; Wed, 6 May 2020 09:25:55 +0000 Received: from AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9]) by AM7PR08MB5494.eurprd08.prod.outlook.com ([fe80::acfa:5:88c8:b7b9%3]) with mapi id 15.20.2958.030; Wed, 6 May 2020 09:25:55 +0000 From: Vladimir Sementsov-Ogievskiy To: qemu-block@nongnu.org Subject: [PATCH 8/8] block: drop unallocated_blocks_are_zero Date: Wed, 6 May 2020 12:25:13 +0300 Message-Id: <20200506092513.20904-9-vsementsov@virtuozzo.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20200506092513.20904-1-vsementsov@virtuozzo.com> References: <20200506092513.20904-1-vsementsov@virtuozzo.com> X-ClientProxiedBy: FRYP281CA0017.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10::27) To AM7PR08MB5494.eurprd08.prod.outlook.com (2603:10a6:20b:dc::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (185.215.60.178) by FRYP281CA0017.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2979.26 via Frontend Transport; Wed, 6 May 2020 09:25:54 +0000 X-Mailer: git-send-email 2.21.0 X-Originating-IP: [185.215.60.178] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 375643b8-3fa7-4da2-bb4b-08d7f19f7a7b X-MS-TrafficTypeDiagnostic: AM7PR08MB5382: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1227; X-Forefront-PRVS: 03950F25EC X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: EHawf3pCvv8ui+5n0JWH9kXHeb6E3fLv68K2Iyf4bmRryqBKyCaNwECOsY/mU1wFIb1fssKNpU9dUisgFZOKladUq6vd10LnHac/o3Z9lzK0+MKpVRBWxqwBfGmlgSJzNjRGx9NwQSLmctcLeqomDbt+vRKof9NBrnEjBthAwaLj8u9uYhLYLAJn+QIWlqhqYeS/kAE26OHz7miZcAunzYd+M7iy6Hopx3Ifo2q7yDGyO0uS+jPJy7sxI1zZRJtlISJa1hWF7pLqDq1peKH5K90o6xBpk8tdqS+piP0egPQl1G/yJDjZc7FyzlxDQbEVg1eeCy04duKS2/I5ZgSwrht7oRtVoZl6HHD1zvajiWOae3XrAlz9c28WPuueyBZbMfbPnhDsoDKk51S9fd+4CHb+Q1DalcZ3WAeGgsREiuM6RM841MEbG1bWqhOdTbX5HgiKO1BsUP5tNzRkbA5VuNIXaPzz6cmTZqD4wJkIEzKwmqmEmZEZSO3tsQVtXiWsYizmrXPO5+S/zQw1OaEJvUjaNo4C4vpC3NNg3XDRS3NavnQxleCqi2tNuntzwjsI 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)(376002)(366004)(136003)(396003)(39840400004)(346002)(33430700001)(6486002)(6916009)(52116002)(956004)(2616005)(6666004)(8936002)(86362001)(26005)(107886003)(2906002)(6506007)(5660300002)(36756003)(478600001)(16526019)(7416002)(69590400007)(186003)(66946007)(66476007)(33440700001)(66556008)(4326008)(316002)(1076003)(8676002)(6512007); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: yD3H28PmdEGsg8UmJmHNcsUSJ/vSvCBTxhD5oecqTws4MQrN7K0Ylp696XaTuYQ+Wc6gFJpJk3Z899H6UiJvvy5xGwFLYXfCsbctVhRThrnsHMNm3d0wzWPZrrsWvnG5rV7MkLUCBGy8ifaJhHxyHuECMyrjJYSbeq2uSlzmHfjQntiLSxxbk5MKTV+gGuJEi9h0eE90XuOK7797SEyQL6JcL1GaLrNxFcNsIA3XU3EMycAm46AL1xa963vp1IVKAybajbfQFkzUC6sSt8SOB+yVXy1V9WmMfXLPxrut22sdJH6EHNEjp7L8wh72r7n2Bdo3Ai0BGsO+TUz/LWdDJP6s0+Bz7V0W9PVlBa4LnMnbsQjQJ1dWJdHo7p5D5wKxL8ubEABxlXkfUX/Z1Isp8FKAJcZK0wObPWoPqNArH0JEGFb1lMmubyUYcVyBa2l4opB1xtOORjlNKnrh8xetD73QCTCHOUZdzofuUQWgk1TwHyGm0XV32oTUVkF/umVwjIqsilUAVqAkIHGF/qdH1G/vV0zHwjeaiGmAfR6+/K+FQSDPaTveK1rtssXZso72LELBKMjZRX72f0WtOAybwYbv4M/JU9uOFjErpzcdLCt55/M8AhwADf1+L2oWOsNjDpR2SF0+1L/Phc00lxZ7tFnga2gMPSyA4EV6ppHWZzRMqA58HsYNbGehR+xfmr+3U/PlG+DT6vCODNFpGi/A50bt3mQEu6/S5d7rGeGB6IuOfGJY+XMTxNZs8bYlnbE8qlb3iD14bOoeW13a2TIUX94XKYTGMEMYaVdNyW1wAi8= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-Network-Message-Id: 375643b8-3fa7-4da2-bb4b-08d7f19f7a7b X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 May 2020 09:25:55.4293 (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: 7erHHS9DVNUZnOrIb162gkF0LLE4XkDdwFDjQfBYLJetXYbrxY4nI/9gIjM04+ybPrmpIsIQEBwCsMwxdJbB8QjwBhq3iSXQHr3fsXAmbAI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5382 Received-SPF: pass client-ip=40.107.2.115; envelope-from=vsementsov@virtuozzo.com; helo=EUR02-VE1-obe.outbound.protection.outlook.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/05/06 05:25:49 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: fam@euphon.net, kwolf@redhat.com, vsementsov@virtuozzo.com, stefanha@redhat.com, codyprime@gmail.com, sw@weilnetz.de, pl@kamp.de, qemu-devel@nongnu.org, mreitz@redhat.com, ronniesahlberg@gmail.com, den@openvz.org, pbonzini@redhat.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Currently this field only set by qed and qcow2. But in fact, all backing-supporting formats (parallels, qcow, qcow2, qed, vmdk) share this semantics: on unallocated blocks, if there is no backing file they just memset the buffer with zeroes. So, document this behavior for .supports_backing and drop .unallocated_blocks_are_zero Signed-off-by: Vladimir Sementsov-Ogievskiy --- include/block/block.h | 6 ------ include/block/block_int.h | 13 ++++++++++++- block.c | 15 --------------- block/io.c | 8 ++++---- block/qcow2.c | 1 - block/qed.c | 1 - 6 files changed, 16 insertions(+), 28 deletions(-) diff --git a/include/block/block.h b/include/block/block.h index 8b62429aa4..db1cb503ec 100644 --- a/include/block/block.h +++ b/include/block/block.h @@ -21,11 +21,6 @@ typedef struct BlockDriverInfo { /* offset at which the VM state can be saved (0 if not possible) */ int64_t vm_state_offset; bool is_dirty; - /* - * True if unallocated blocks read back as zeroes. This is equivalent - * to the LBPRZ flag in the SCSI logical block provisioning page. - */ - bool unallocated_blocks_are_zero; /* * True if this block driver only supports compressed writes */ @@ -431,7 +426,6 @@ 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); int bdrv_has_zero_init_truncate(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/include/block/block_int.h b/include/block/block_int.h index 92335f33c7..c156b22c6b 100644 --- a/include/block/block_int.h +++ b/include/block/block_int.h @@ -115,7 +115,18 @@ struct BlockDriver { */ bool bdrv_needs_filename; - /* Set if a driver can support backing files */ + /* + * Set if a driver can support backing files. This also implies the + * following semantics: + * + * - Return status 0 of .bdrv_co_block_status means that corresponding + * blocks are not allocated in this layer of backing-chain + * - For such (unallocated) blocks, read will: + * - read from backing file if there is one and big enough + * - fill buffer with zeroes if there is no backing file + * - space after EOF of the backing file considered as zero + * (corresponding part of read-buffer must be zeroed by driver) + */ bool supports_backing; /* For handling image reopen for split or non-split files */ diff --git a/block.c b/block.c index cf5c19b1db..0283fdecbc 100644 --- a/block.c +++ b/block.c @@ -5305,21 +5305,6 @@ int bdrv_has_zero_init_truncate(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 a4f9714230..484adec5a1 100644 --- a/block/io.c +++ b/block/io.c @@ -2385,16 +2385,16 @@ 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) { + } else if (want_zero && bs->drv->supports_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 { + ret |= BDRV_BLOCK_ZERO; } } diff --git a/block/qcow2.c b/block/qcow2.c index 2ba0b17c39..dc3c0aac2b 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -4858,7 +4858,6 @@ err: static int qcow2_get_info(BlockDriverState *bs, BlockDriverInfo *bdi) { BDRVQcow2State *s = bs->opaque; - bdi->unallocated_blocks_are_zero = true; bdi->cluster_size = s->cluster_size; bdi->vm_state_offset = qcow2_vm_state_offset(s); return 0; diff --git a/block/qed.c b/block/qed.c index b0fdb8f565..fb7833dc8b 100644 --- a/block/qed.c +++ b/block/qed.c @@ -1514,7 +1514,6 @@ static int bdrv_qed_get_info(BlockDriverState *bs, BlockDriverInfo *bdi) memset(bdi, 0, sizeof(*bdi)); bdi->cluster_size = s->header.cluster_size; bdi->is_dirty = s->header.features & QED_F_NEED_CHECK; - bdi->unallocated_blocks_are_zero = true; return 0; }