From patchwork Fri Sep 21 17:23:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonid Bloch X-Patchwork-Id: 10610743 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A317D913 for ; Fri, 21 Sep 2018 17:30:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 87BB92E395 for ; Fri, 21 Sep 2018 17:30:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7BE2A2E39E; Fri, 21 Sep 2018 17:30:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 167632DB11 for ; Fri, 21 Sep 2018 17:30:09 +0000 (UTC) Received: from localhost ([::1]:56734 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3PFo-0004kx-1D for patchwork-qemu-devel@patchwork.kernel.org; Fri, 21 Sep 2018 13:30:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57551) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3P9o-0007so-Gi for qemu-devel@nongnu.org; Fri, 21 Sep 2018 13:23:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g3P9m-00048X-6v for qemu-devel@nongnu.org; Fri, 21 Sep 2018 13:23:56 -0400 Received: from mail-dm3nam05on072e.outbound.protection.outlook.com ([2a01:111:f400:fe51::72e]:43040 helo=NAM05-DM3-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 1g3P9l-00047z-W5; Fri, 21 Sep 2018 13:23:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janustech.onmicrosoft.com; s=selector1-janustech-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=SgiOymsmdHx6bhtvMdG/lVs52eoiAujl0mFWRdCPnwU=; b=eEiJUjXndbBRjhNqVkrfsEYCim0Y0G1y2owXsHLsWIt1QCVNVxic2orPT/BrfmMVOxN4TIQSZKU/oppkknjQqOlzSJTaUPDtB0jsWj4+sbimxx17CZfjRSKR1ADJhf/CiCPNhOfEMmTCX/jxca214neB0czKpfJlrk72MUx3LfM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=lbloch@janustech.com; Received: from Jupiter.local (141.226.29.227) by CY1PR07MB2618.namprd07.prod.outlook.com (2a01:111:e400:c637::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Fri, 21 Sep 2018 17:23:50 +0000 From: Leonid Bloch To: qemu-devel@nongnu.org Date: Fri, 21 Sep 2018 20:23:05 +0300 Message-Id: <20180921172310.10068-5-lbloch@janustech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180921172310.10068-1-lbloch@janustech.com> References: <20180921172310.10068-1-lbloch@janustech.com> MIME-Version: 1.0 X-Originating-IP: [141.226.29.227] X-ClientProxiedBy: HE1PR08CA0065.eurprd08.prod.outlook.com (2603:10a6:7:2a::36) To CY1PR07MB2618.namprd07.prod.outlook.com (2a01:111:e400:c637::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ef5b0563-95d8-469a-6dff-08d61fe7006c X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(7021125)(8989299)(4534165)(7022125)(4603075)(4627221)(201702281549075)(8990200)(7048125)(7024125)(7027125)(7023125)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:CY1PR07MB2618; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2618; 3:xRmixEDVic1oXyRtbE+4E96nb4x+X2PIVE2WGdCx15+qhM5AjTZI86z5PAfN3AhOrBkGGCe7v+NsdJVotDsKGZddmk2yP7ZX3guDuBlLPinuAX4kLk6STR1sSHGSCjjFUEIna1owWsBzGDpeKVBC9GSYNXodOryzZO0r5N4A7vBcoiNaVIjG5JLL5Cdpnfmz+NHmCytZWgIJFb5tWC2deZ7x/0uO7j8oQLqS3ab7KpBCldAayqxeutBgmqoGo8+o; 25:wGHoLotppmM9gLsVyGrNtC/7/9Y0dhNDO7r1TAAZlPDVSoaJ6O1aW6DE2JjYrIteDkbQWcGAJiBl93lu40aJab8Z2N11Q5dady2spl3A+zNTCB8kwc7bR51SCamthbjdS2hnz93L9c23s3au0SrhVwnbCYnY0fxi9xA0vnnLeEuhazJ430qiqg5y2i+DyDqG7oPxmAk6RTmCnJzuzStFJsOKdKnFeK6U5tYpX1UMk8Ol0mPpEq6ukdSJfpaMMQ0B6uodooZAQHKDYmnPmBARA1j4HoaD3AZHDWrJobRiKBgG/QLlet1YZcHoP5QilHpo2K831B747HjJb2Y45BokVg==; 31:283N6kcdjFD3lHQkxEw9QcleZWCJcpG+Dl033QgJQsKLFZwyFVZF0Z93nW99qxCqHucekpj8Uq/Khv5jGyVGtGFlTYVdnD+UgJqoeLGYtIA/FPN7focl3+m4AeCo9QllVu0Bxjj8t04rJdf8qPg4ChU2yzxlREA+uRN2Ap0Nw8jmApdFm9LEnAruS/ua7dkFIQBarS7gDDdl6sXNCT+SxSfV+kzD5UFw1mfLfGALIdk= X-MS-TrafficTypeDiagnostic: CY1PR07MB2618: X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3231355)(944501410)(52105095)(3002001)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(2016111802025)(6043046)(201708071742011)(7699051); SRVR:CY1PR07MB2618; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2618; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2618; 4:IR5twNwo7XStAmYBz8BRmifixbZLT/Dk4aOuRDk89CZjHy6Z4/xh0OrEvmKj00B1fDgS5LWG4QNXCUD2q0rMxYxKempoqQWFfLyoA2wx8JV6rID29FbERT8fSH6ZiUiXJVL9But2yKKpKU2lLm3beDA6YyG32F/eer0bVKJcNzcz4WrotycLyjkMPm0Cdyvp0uAY+au4Zxg4OlcTr+kxvce8Gti+Uwb7yx2pXLnRAOLA++p50H9K46wItnSKglT3+hoz317dUJXkiznPG6lRhw== X-Forefront-PRVS: 0802ADD973 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(396003)(136003)(366004)(39830400003)(346002)(376002)(199004)(189003)(86362001)(68736007)(50226002)(106356001)(8936002)(1076002)(2906002)(6116002)(4326008)(53936002)(305945005)(8676002)(7736002)(5660300001)(81156014)(25786009)(3846002)(6486002)(36756003)(6666003)(107886003)(6512007)(14444005)(11346002)(81166006)(97736004)(508600001)(47776003)(105586002)(2361001)(186003)(51416003)(48376002)(6916009)(50466002)(486006)(54906003)(476003)(956004)(66066001)(6506007)(2351001)(16526019)(2616005)(386003)(575784001)(316002)(16586007)(76176011)(52116002)(446003)(26005); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR07MB2618; H:Jupiter.local; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: janustech.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR07MB2618; 23:IKCGeXxDkB0m4lMeTIap7twWOYzNUhmph+2dOvKKz?= l30JGrGoGIAVdzaTao24AaFXMFuno4aVVpJU0j6BRCGuAmZk1aIM1f1ElrZwNpAqn+prhfGGiDmalqpZgZ117rXwvgz57Eeo+HBVnfBPxDHpoTlcFb8NhxO4dvuSib2b7KjWir4/8K/Zzs19fGpdxgVNj/OjT6aeZn+8JG1jVWNGPG795IvEn2WtfDTsAqQKWnc3ATBzVG/EzvbiDDfDN4UTGPF7WeKcz/4S3pePuWccTEbx8C4k++eKn20tip2nGQsbWvaL91X4YizwA+MxVYX6oJpnLG7IrsQ924OE6qtdXGO0AKz5YbiwyZdBQ5WpwDi7IdCfciAEQAeQQ7NqShGm9fBzpOD+Qy+CF9BVRMs1Stuvs2fywt1rnDrxUqpU9yA+N9orOPO3LV1caLxmdAkxa4Ju4AhUiKy9fwkzHmbvfkCMil3+8OH0SbbL3yaRopMGK3T92KkyqsWyzYiHkQb+OnZ1dvrnFydh/WoxC0Lp/bbclqiplyOKduhj5mX+4OStUkpE4JnqccJATdbgF+xiKD4PQRbUCZruGv4ers2tYkPPujmogP7Gc/BEwCGsS93EjMLEtRDCsnwyZsPxjtsHulRlLMZoxA2v8gNhgTOFUx4Frz3zft/ruC7NwezfDkjlSnn6Lqqjizaf/NjU4gzw3i4mqFilCpDZNK7we5dGJkVKRHvMGmNuQBCVjwz/dIpzZRWO/jDYU9kwwhGjCd+uaZLdnLbbLrvr1RvpRXy/ui95PuXlMMrXVVI0iP/hsNFZEUQqRZ+W0e60pSCduGviCibY5kJ/4MmvQ2Q7uJ3dOB4UduS68pI4Eu0PTPPSi7jaMy0qYrGdyH0IBCkppnNKrYmoIyT1mPgdWM77q15ywUHZZYN4uSwYik+el8sVcWrALIJc3fralZ/NzQXP8OCrz/k1EtjPkIUwCiM/AzpKYCQhGAB5tE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+rMd8h8spz6hrRhJVQ0nlUOOzl1kBJzgEMeNl6Z2DN3s1GlL367ssc09CGX9HbC+TUBF6oQUQnPPu1VGKkUwENL1iNTfmZCY6cuvZyFDm2deq8gUERcI43V2WL2x8AEzjwg==; 5:GTtPe2a7DEyH2xg9K/wHeoeHmLG+96/YE9487j+CgHxSzlmnu9HD1NZZfHFN7WSe3N7GyAKPRZA0Vlf6lw46vj9rD5JxAXETzKepkCi9UKyyEqI+YdrWQ+XB5Yk/eAEkVY4ZT0ZLyM/Ak54WHsXn2imYJfl0c+60x1a7pngkSN8=; 7:CgLN489JVeiMPj+Lf5n53vYvK1acmihh73qnyBKft5iJ1Q/bC8zdlQ2RniiLB+t3VPZqBOKHP4Oa9CZH/2H/+tlnQGpUzPGwACr4IL1SWt2ms+XTNu9pAB8SNRXgZCO/O8AdV9uQh9wiEbPjLRT059U4K4RxIAieaG7GFco1Z/cc9HORX1K5L1RF9Pc+pS9wwYgolIjW5Z9e0ckJyU+u2ExxfL5Pyiz2aCk4D/mbv70Oa2Fc+0DzY6e5IuZhvU3O SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: janustech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2018 17:23:50.2172 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ef5b0563-95d8-469a-6dff-08d61fe7006c X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 34eb020e-3cf3-43a1-afeb-f5cf1310628e X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2618 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 2a01:111:f400:fe51::72e Subject: [Qemu-devel] [PATCH v10 4/9] qcow2: Avoid duplication in setting the refcount cache size 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: Kevin Wolf , Alberto Garcia , qemu-block@nongnu.org, Max Reitz , Leonid Bloch Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The refcount cache size does not need to be set to its minimum value in read_cache_sizes(), as it is set to at least its minimum value in qcow2_update_options_prepare(). Signed-off-by: Leonid Bloch Reviewed-by: Alberto Garcia --- block/qcow2.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index 67cc82f0b9..7949d15fc6 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -834,10 +834,9 @@ static void read_cache_sizes(BlockDriverState *bs, QemuOpts *opts, (uint64_t)DEFAULT_L2_CACHE_CLUSTERS * s->cluster_size); } - if (!refcount_cache_size_set) { - *refcount_cache_size = min_refcount_cache; - } } + /* l2_cache_size and refcount_cache_size are ensured to have at least + * their minimum values in qcow2_update_options_prepare() */ if (*l2_cache_entry_size < (1 << MIN_CLUSTER_BITS) || *l2_cache_entry_size > s->cluster_size ||