From patchwork Wed Sep 26 16:04:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonid Bloch X-Patchwork-Id: 10616107 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 C71033CF1 for ; Wed, 26 Sep 2018 16:10:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C07C82B3E6 for ; Wed, 26 Sep 2018 16:10:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BE5CA2B3EA; Wed, 26 Sep 2018 16:10:16 +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.7 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_INVALID,DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 18E832B3C8 for ; Wed, 26 Sep 2018 16:10:16 +0000 (UTC) Received: from localhost ([::1]:59621 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5COE-0005dh-7U for patchwork-qemu-devel@patchwork.kernel.org; Wed, 26 Sep 2018 12:10:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33820) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g5CJm-0001vZ-RY for qemu-devel@nongnu.org; Wed, 26 Sep 2018 12:05:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g5CJk-0005kS-Oc for qemu-devel@nongnu.org; Wed, 26 Sep 2018 12:05:38 -0400 Received: from mail-eopbgr730130.outbound.protection.outlook.com ([40.107.73.130]:13864 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 1g5CJk-0005XJ-FI; Wed, 26 Sep 2018 12:05:36 -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=5qeZHhNXaAowsh9zkxJ0Qqu90roMvHxi2nM2aDmEiyU=; b=oPJyYe95sfs5FJC445qS2Iyc6S4sq2sUbPp1VW/ExSO3cVvm0dnFkHRuOskCAkq9Qyu8BMy529h8UJSeZihi3HFJur+la7CXmrZYJ7hbOFdMJpgH7AVXCq01Oby515ahGQ8E9ykg94U+wqZOgT2lqA7xAgWy7ACr1y7wkpDKCws= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=lbloch@janustech.com; Received: from Jupiter.local (141.226.29.227) by CY1PR07MB2619.namprd07.prod.outlook.com (2a01:111:e400:c637::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1164.25; Wed, 26 Sep 2018 16:05:27 +0000 From: Leonid Bloch To: qemu-devel@nongnu.org Date: Wed, 26 Sep 2018 19:04:42 +0300 Message-Id: <20180926160447.5149-5-lbloch@janustech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180926160447.5149-1-lbloch@janustech.com> References: <20180926160447.5149-1-lbloch@janustech.com> MIME-Version: 1.0 X-Originating-IP: [141.226.29.227] X-ClientProxiedBy: HE1PR02CA0116.eurprd02.prod.outlook.com (2603:10a6:7:29::45) To CY1PR07MB2619.namprd07.prod.outlook.com (2a01:111:e400:c637::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bfbc6eaa-838e-4910-c8fa-08d623c9e190 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:CY1PR07MB2619; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2619; 3:h5UPiGs7TNBfQd9291HI9GDcLx0k6PQtrElkSK81YNsBKfVkYOHjAOyVUlk4rA7ufpkg44ur1lJkb04sKmpob+liG7Sp5OVTBt7qXGuZ2YSu/TnxJ6nJX2AptK6eV6A+Diplb3YvtSYHX1OI369JCNhnRFSN1fxL2gtCzKJXIqHzk4iXzC3Z97qoqWJ7O2XQFaLxV9Y/DHiK89Nx5c1rpfgtNteBSe6zd4dRLP6hgiA8qYi/YJ5cO/N48GldQU6C; 25:oAatziLB1vRWAcTsThTjCJTgFMMI0i4jfrK4WQuMyevL9/gkeauhU7nTodeXmKqBUS67JGwAwScNrJ+0YVotJlA1ngMlYDRO4jC7Ttdh3EOeYB9I0G7IiwE0qwN3tm5zN4j+MqFWJXwdyyNRmXTT6xgU6jgRsGIto0ICQ29VvJXQzQgl+S58RPjuuVKY961zCy/uTqkiR41NoP0sm1W8VfilLsSfw8XGTqJ1cG5jIBKNY8AA0aSF66drPH+43hKmP/NwnwNgx1X9eDBK0lb7mq7wfveO6HaTcQDYRJKDS9xrj8HXJmDMaMr4M1zinfVxSlVemwfz4h60UzHOk/mfwg==; 31:Ev/YPHH3HRW2G579Ss3rdOTE1SK081r0FfZ0BwBDuxJJ+rR7HrAUENgcfzdba3Gix86nZTdeC0/DVodhSqLtia6b22acDrA0StiO7Basu0j1XVuknI5DxjBl0Xbi8Y889GkqF/9QbYfgzaEo/MrypL8QbpdTVmjiLMfO2CDQMAN5418qJGpFudD4C7hDcydl0JhbAp+HCQRI8soa2d063vVOdkbH/dBWpGZFPMLnosE= X-MS-TrafficTypeDiagnostic: CY1PR07MB2619: 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)(3231355)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(149066)(150057)(6041310)(20161123562045)(20161123564045)(20161123560045)(2016111802025)(20161123558120)(6043046)(201708071742011)(7699051); SRVR:CY1PR07MB2619; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2619; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2619; 4:Z/FBGHwwYUrF582Hzbr+it7We3432fV2UFnKTdyRhZDCfJx1nTE0XJg9ooBXaFWBdDOnBt/Bh5T2FjuvkQy3m2pLHcj/6gP4RIXPrsWL2mQTe1eyENedhQ6eYiM+3MD0GmkfaHd7eMvd7x5aut1Qgz0unHwtdMoRvr6xz4fNXdfPYNa6hvlBq7AwuB88ZQE04FdewgE6f3tP5zuX/ifEr4rrDQ8E7bawK+Sb9JosB4cK2cEJhWIhI+pGkI8DDb8K25JaknyS2afurKJfXkvsqg== X-Forefront-PRVS: 08076ABC99 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(366004)(136003)(396003)(39830400003)(376002)(346002)(199004)(189003)(106356001)(508600001)(66066001)(6512007)(47776003)(4326008)(48376002)(2616005)(107886003)(446003)(50466002)(956004)(11346002)(36756003)(486006)(6486002)(476003)(2351001)(105586002)(34290500001)(316002)(16586007)(14444005)(54906003)(2361001)(3846002)(6116002)(6506007)(386003)(1076002)(51416003)(52116002)(76176011)(26005)(2906002)(305945005)(8936002)(81166006)(186003)(16526019)(7736002)(8676002)(81156014)(6916009)(5660300001)(6666003)(50226002)(97736004)(25786009)(86362001)(68736007)(53936002); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR07MB2619; 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; CY1PR07MB2619; 23:M0QNrY/1MZvHLB01D8TK3Z6IKsOX7G536GaG4C7Br?= expjeteEV/Rwc3+lSEqytyfDU43rc7P1eV2RXgx+v56ipFVamh6SEXPrU+5/euwSExc9NXc325FI4cAaxPn1n68MTJKGCC9pUYCt25Gy8s3qHSkFrX2LPSEgGgq1vuz8T3jRc7ovMnUX07CegjB1b19ikXTx+A62Ujpni1xyUIzZFYQtC5UnBBzIbNk3YE//zu7JisLVcIzn0T8DYf2sJPo5YjTHX7b8a3hbkAVqSgcjEr+MIgUovWExjAihRL0TGExjGhmYDRamb0nuSOLOb70m/Hy+TowVPUDZVAHd9MTf/iN+iyldlarjLVayqtjw+DX+RNgEHJVHl5bF3qFwjzfPJcfWz7yUTu73ByvZCFByC5zKMQkpi5hBytUqTKAMkbjulo47E07bxKHJVSBkd36fxAssXtZi0Mx5jZqdV7P9I4ak09L0jLonFUQbJSIP63MZbPcWrXc/QGy6WXwexgKv9GQhwpaAKYpJkNGnblntcxat8uvZIfnvTriqs3Ob/LB+1GSsBEJMYOeEyibpB1jhIDM6T+16vDWfu+nNxA3y2b2NW9MpGylh+Kf43OnOvmvS0lTBk6LcGGD0TJhvkoXyptS2ugNeoEO06gP3pEGugR5pelTgAyABPMKfRzEI2M9EsuibGW+0HiietwvtlTsYX/PCqjui1lYFRaqc9vWaJCdUeHQkYvw9uLCpFA951L5vJhYhZkUvC0K1+OAPdT0tsKUCWey8gxPOqs3MVGGt4NE/9I6Y35d4e2X6thINgCdc0yxbGtbiIZwhaJiOlsJYFHWk1tSH99Jemq+akalc4ao2l6J5/pAiKSWAnDsGFfgsSBoPSTTzx4JltVi5G5IbnXzNcV6zftbuZwmuU41D+oOZS3h3ZmPTdlguIPz1lKLwENt4zhPPrzqX6ZNZQ4qf6+/e1Z27IB1o78falWERo2hlsUV8NOqIbtX+PJtXVHJxYJ4taEyYOBhS8DDjSC/1gUv/9C2mXEYPtoOzBPOhUrXIzcJPMt6xklJQwtOHkpaGuvEWys8OJoz95GvG40U7XtDDHdoz0Pta83zypLlQfOS/+1PnhvQZVnilJGabZWsz4WcSVhnJgWWrsaGYvfztPpHUtcnUJopWP8Snu36wv/NXo9Un6ToPoc+KCfJvbjNRcCuejgfxvXlaSp1AGv6ONgjUusg07Po1Uyjxa2QPzFHI7MBxocFZrX+IZXp1rQc2kPx7Xct1jn7Cjb59057eqJDnD9z62v3Aa08boihjLoM+I1KooMMzHuf4PuPB8I= X-Microsoft-Antispam-Message-Info: 6nYO7iyVBksySfm9vfMob5DyarA0o5+Evz0n3bQOlqknSZWlGOIGZqY7fP6VfEabyBZGaZ4/K8KCetrfJ+0KBIu2vV6q8Nv1kNi9QLytpIsTojInkOsTD02L+BM+OgDddb0dSLmnxYuCTeqmFNpz+jkzPzscqXm3eOvLDPjWSB+t+B4DlTwm4+mrRFuN0nUGBxatilPhq73Gr56RON42HVUV3JKAWN+0T+QY/OY2zvoIKFcJj0gihHCw1K8BJOGkeLqgs59/uc6GDrndh+ayv6HG6SIAfi7RPkIVCmpb0poJB+35juReVao+HXzGez/DL2ezLwjpcI/++6wnFlHFDda3VHzVW4qkpp2n99yvaAA= X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2619; 6:sSEZG8H4VVTEtaAPYXQ6MmqUUROuMxi33Sgt743piZWbtKn6QV7fo11w2d+mSMKzbp/50x+O+15cUA/LZt62qpS3Dp/0XOzs83L0MRwLgw9v7IpNkY694LDYSPeFyugPz7aUtFATd5P/sR+vipvXV39qPy02PrTrIK0hGjuoAjSG7oC4jcKOO776z5vQpxFO6V774LH/ZqszC8q9O/crGQpxHugosG58PySY7cmbyZW68qW9v+FddGz8MrtXPfHXD4t91150gpAV/R08KEAnXiF5+/jOk9ggNdt1S4fxAbsQL+FmoTunwhN+FSCVc/vPZDawFHIrgML7ut+JXbMEv0zrTm3sPwNo44sLUoTnAPTg5H5PCZmFoPDA9rz10xFrntGSH+xf4YRUuteGbi5lprBlN2EsYr+AzKDekpItrifBsLrf3+UcpL4MHBNv4cwEKGlZodjUY6Yl89i0V6SsHg==; 5:iJ2TWXtb8ZnV/o32HS6uIZzk4WeK4O829HNeOxYAKOZdB31mjQ6EYIpUoR0eLr0RhdB+QvtpyVdgpcevCqvwaLvuBkBVbwEdaW971SWeXYrlBwID6C87rXMyvflYKCXxM9rMk/iE7N/6Bi8wY/slvY7rtyG88CugJCSMcySlprU=; 7:ehbrUGqiQ/2CBeLTybxr5oolkRovJzq63D/RSYW9kmNOBAfYw7m0c5FkPoFd+W95/G2stxbKJWhUH3FcHyW5dkcsoM/WxxOllhK7GB3KoW9n7BRZKxH/4H+Rbx5NzJfN8s64kVlFS0/saKFDPiA5RmVIUXTGci2XweHz/rW6CG1Bvj1nT3O3Tybjv6tYNtBgf27/vIdnVzLe14ZXdh5NhZJGFGdE8tdnjDkDWxhy5YbPG5SXPZ5r3GIWy10aRHIK SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: janustech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2018 16:05:27.6935 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bfbc6eaa-838e-4910-c8fa-08d623c9e190 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 34eb020e-3cf3-43a1-afeb-f5cf1310628e X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2619 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.73.130 Subject: [Qemu-devel] [PATCH v12 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 Reviewed-by: Kevin Wolf --- 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 ||