From patchwork Mon Sep 24 22:53:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonid Bloch X-Patchwork-Id: 10613021 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 567CF6CB for ; Mon, 24 Sep 2018 23:11:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C8B92A083 for ; Mon, 24 Sep 2018 23:11:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F0E02A086; Mon, 24 Sep 2018 23:11:49 +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 DCB272A083 for ; Mon, 24 Sep 2018 23:11:48 +0000 (UTC) Received: from localhost ([::1]:49178 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4a16-0006GT-2l for patchwork-qemu-devel@patchwork.kernel.org; Mon, 24 Sep 2018 19:11:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43374) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g4ZwL-0002Rk-2b for qemu-devel@nongnu.org; Mon, 24 Sep 2018 19:06:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g4ZkZ-0003IX-Jr for qemu-devel@nongnu.org; Mon, 24 Sep 2018 18:54:46 -0400 Received: from mail-sn1nam01on0133.outbound.protection.outlook.com ([104.47.32.133]:43879 helo=NAM01-SN1-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 1g4ZkZ-0003II-Bw; Mon, 24 Sep 2018 18:54:43 -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=hVzw/eyMyNSoLzb9G8eDuWUpDbKVVJtRCFS+tcX5Qy0=; b=GLDzY1P3AESVp9/E2/18ppG2cgXPdm/vjddhQg6EldWNYByXPdX3wNQbgnkzqyS7fbAPlZ1ZKqUWWAL8lzHZ/H/5yXxTwq+BCCoPWvWu9gdfct5bWgIhsNanQsnyKtT8snJcKxFfGo3avpF7TOZy+1hPnJpv9FmtqpbcUQoPhTA= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=lbloch@janustech.com; Received: from Jupiter.local (141.226.29.227) by CY1PR07MB2617.namprd07.prod.outlook.com (2a01:111:e400:c637::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1164.25; Mon, 24 Sep 2018 22:54:39 +0000 From: Leonid Bloch To: qemu-devel@nongnu.org Date: Tue, 25 Sep 2018 01:53:52 +0300 Message-Id: <20180924225357.24245-5-lbloch@janustech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180924225357.24245-1-lbloch@janustech.com> References: <20180924225357.24245-1-lbloch@janustech.com> MIME-Version: 1.0 X-Originating-IP: [141.226.29.227] X-ClientProxiedBy: LO2P265CA0063.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:60::27) To CY1PR07MB2617.namprd07.prod.outlook.com (2a01:111:e400:c637::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b18dbcfd-ed30-4321-8558-08d62270b6a0 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:CY1PR07MB2617; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2617; 3:Z8XiWQrwV1zdIUquHonke0VxUewrsSj8S5CPXb5QTPkMZyQgHI8nTZ/Ho5qlYTTUYs/J2h4f/LdwBXel9dmOAVThACX2U3NVf/MigeS3wW5FxB+hKVxXSWRRFVKZw9TqA5sBlPPUlIAVZEvsgzFAXeOVmtq4ZL0Wd44EqSTn1no4WHHi0sVIlhsw8BoDmnYbXHzjBYpjmMpRgutxMAHeyI+4jDwYLfU61xD5WdUrpV6hKkEsmjQP02ouZCJ1AcO/; 25:ao+oBfuQgFijzUAnpD91l5NYnoqLxrwYOTVYtY7evPUlPSa2DTCYTRM3Te/mR7pxEkBtvffSE24U8MCJknvGY4DGiAWYKxCl9/lkZEn/h0sikuz+MRakOp9iFl4D2a7Hogxhx8r8BmoJSI8vewCpMOiAqjCUJKbYI0KX077Eov+Cmxdu99i/l3rFJsKkasvzijcL4nQS78tY+FB+GVDKyR4WgWuHezgdteuFJ9Ef/xOrfNs/B8aambuleHIsDeU1DiKj4ONXYpkO1JOpnW1bHAsPIJlA0J69D6GVIZRXpPuclW2z3oXb3siGuhZTxP7ntrMRe5mS+CfXmYr7aM8bMA==; 31:sZ6/smz/kU86H54lvFs/o7iHHalbL1Gos66JO5tnMQFIUMhbM5hwWf3kV3VD0GKCFYOx9TZH65JNubgBiAZ6rIsVkYIN3EVDlQOzN7ettJD028uC2xa59uxowMVeWgrL4UXV+NTxiFbQNuuWb+NXCgUFYsV8DTuuLukOQvMc8fp56df5ebO2k7vz+2aeq+q1cGPco2KD3QOMZ7ZzR0iVOtV36Mtn+Sau4/2xkaA43VU= X-MS-TrafficTypeDiagnostic: CY1PR07MB2617: 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)(8121501046)(5005006)(10201501046)(3231355)(944501410)(52105095)(93006095)(93001095)(3002001)(149066)(150027)(6041310)(2016111802025)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6043046)(201708071742011)(7699051); SRVR:CY1PR07MB2617; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2617; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2617; 4:Zu4sHld19e2UzG+JY9ECzEQdi1GZkUGM3ZmJ6PcGSJwGBPyL65qtMREuKD1KA9IMwDEeBNEmhR3lewF/cKbSwHLjSHoxXsLS4e8F7TCQtT62p17fR1F8tO0mGwBCV/uSM0clOKu9YgBjyx2nufY2f6qiaBm4inx62wYvQp4bilnnKXT0SdkYvSy1wfNdS5Vo5EyJ2RLHmOfZ9jEvmzV2D3x9rjrxF3LYj0gU5rMrhC322BVcfKcKdd85GgJjjz9C7S8A+Z2gA85WN4XYoMOIwg== X-Forefront-PRVS: 0805EC9467 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(396003)(346002)(136003)(39830400003)(376002)(366004)(189003)(199004)(476003)(54906003)(68736007)(14444005)(956004)(2616005)(16586007)(105586002)(86362001)(66066001)(6666003)(7736002)(486006)(47776003)(106356001)(51416003)(11346002)(76176011)(36756003)(446003)(6506007)(2361001)(316002)(52116002)(386003)(97736004)(186003)(5660300001)(8936002)(16526019)(1076002)(2351001)(81166006)(8676002)(81156014)(26005)(50226002)(6512007)(4326008)(6916009)(53936002)(3846002)(25786009)(107886003)(6486002)(6116002)(50466002)(305945005)(2906002)(508600001)(48376002); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR07MB2617; H:Jupiter.local; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: janustech.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR07MB2617; 23:mMx5/RAwwv2Bmf1l8BnGwKeEaUKhFZNN9DboLN1uV?= 4KsLMZvyH5vmhqyviJqw0J5a4gtpAV6kbe2AyX2hVjCAOBjfUIgpkgQSIP1LmtA9nKK3sswxcm5iaKXk9V0Smt25fiNz8yq9agUbsLtRbYMvO5Y9zQOT01E1tjLP4+WobRUzrdMr7P19Nwf5KutHXEn71P0bQuHhkNUFTOnHzkc8r8srdR/uoTB2/82kMHVQqcMAiDqnmtriVnykdSg2+q6l4Ze2SwDvnZzIIAffr+XyVASnM6oLZv8oHx+0fz7hWeqhUf8QN13xowjLMP6Ha4doOiFqc4FJ408jnJhSkbYGmrtcvmEdmiSh9GVukg8WIiEvQXGU13PwwF12AbxaibAD3DAGoWN4TWS6jwEVI4tky8CVH3Fm1yDtQCmsrgXJBR6fRehzQzBtjneUVjQ8RcQw8fBjN51gdC2ecGmuJsfNO5SLxe9tunph9MqT+0puX22V1cS4CevYf1JqAKgrWw3itL0ZCakXtx1+TfR/9XjRV6UZORY49s1TO6aG5Ip77XwJyInFjJV4UsDkQXa1zGEpY911Ag+igxBxUEnN8YLybo0AJ5qR9u4C1lkjEcAAECf5f8J/B7cSnmFC2VILyjM+4+VrRqzU5XFxNGJy4e6bpgoYtcEr5BzHHB61fkPlmdhcQm/rURFHNzjFftOLeocCV6mHAoOeJPq08b6JRNuRVecQaJZEE0KZM1ZY18La1SmdQmXUm75REgGbenY6TS2rvurj2UsxOV/McaSS/jgHGqUhKCcwuBUFDNZDF3TuBgk6zIGa3k05DvlY8hxGf4MMnSh+Gh00rBs2vSsNa5nUGJf5M+huhHnKRutNj4h68e6mbZxvz9tQV5//03dg0Pld1JKR2V3qIecPNxsqSkPaLgNXC77sAlXGpPfOG5abPXzIPcSt2V8qZyvMJ1QHaz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GC9mLLBGkLJVfEY7hGOQQNplCUvyLIr1yNn2HJiAH4YXUJQFVta6wAjsS40y0DOJBUWuOGCHBvQ2qBztt3YRinOkwk0f+fK9oYbasn8QI5frwSX4Vmfe7JkZV80inZ8nQ==; 5:PCr5EpxWCwEWDF8H6knY+X3kSotatAuyLszgOI7GN5XTxN1g0Xqm0S+KpPi+v3YPqVkj8BOoJmmtQytTA+g+0PGIwOgmMnIXZoNvPYyZX+8qV1lqOH3KlnzvhsQxmseBZcKehzmZd9A5ntSxwk1PENVqLEYeSb/QRfvdOWSuLNo=; 7:aSs0QqJH342KHM1dfXsZU2NmtQVR231FFpPvBpgrDGPzzlbQZAm5j/KVOJlgC2d31Jx8G3CCmtAOgNdvoF15Ul9Helv5q7qvanOn5eOdysxoPCk3EOulPbeXRYBX+ZgRPTiurbU+MY4DZ+G3wCDZZcuvjq1C4ACiCcJ8ZBhdRDZj2ZZegZXABoQ5qeGs0XzP4T50jDfxGlsOkSQrqazFRQzlyxa5qGot6JE2FGsdaMREnKgWR/Cv3yP7LSqVQR53 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: janustech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Sep 2018 22:54:39.7720 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b18dbcfd-ed30-4321-8558-08d62270b6a0 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 34eb020e-3cf3-43a1-afeb-f5cf1310628e X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2617 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.32.133 Subject: [Qemu-devel] [PATCH v11 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 d2c07ce9fe..cd0053b6ee 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 ||