Message ID | 20180918152923.24824-5-lbloch@janustech.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> 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 7862C17E0 for <patchwork-qemu-devel@patchwork.kernel.org>; Tue, 18 Sep 2018 15:38:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65C832AAC1 for <patchwork-qemu-devel@patchwork.kernel.org>; Tue, 18 Sep 2018 15:38:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 599412ABD8; Tue, 18 Sep 2018 15:38: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.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 D5AB32AAC1 for <patchwork-qemu-devel@patchwork.kernel.org>; Tue, 18 Sep 2018 15:38:15 +0000 (UTC) Received: from localhost ([::1]:40892 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org>) id 1g2I4s-00038e-Kj for patchwork-qemu-devel@patchwork.kernel.org; Tue, 18 Sep 2018 11:38:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37396) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <lbloch@janustech.com>) id 1g2HxH-00078g-NX for qemu-devel@nongnu.org; Tue, 18 Sep 2018 11:30:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <lbloch@janustech.com>) id 1g2HxG-00042D-AM for qemu-devel@nongnu.org; Tue, 18 Sep 2018 11:30:23 -0400 Received: from mail-sn1nam01on0107.outbound.protection.outlook.com ([104.47.32.107]:28492 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 <lbloch@janustech.com>) id 1g2HxG-0003aG-1Y; Tue, 18 Sep 2018 11:30:22 -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=QPdghDZL5HNXeEQGMUMY+OsKX2AQZ9uYhX+5cexVzo92ocnCPHYe4Xjyr3miVr/SgsK1XRj1lSlWmlLYnWTxa3cN4CYqUA7D98EacAz1q7GgE/85u3Jx1FGJw4dgk7BUY2N8LC34dK4uvnkcW8vbJ0JSD2yiB1NT3PIRZsGvj+g= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=lbloch@janustech.com; Received: from Jupiter.local (141.226.29.227) by CO2PR07MB2614.namprd07.prod.outlook.com (2603:10b6:102:14::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.15; Tue, 18 Sep 2018 15:30:10 +0000 From: Leonid Bloch <lbloch@janustech.com> To: qemu-devel@nongnu.org Date: Tue, 18 Sep 2018 18:29:18 +0300 Message-Id: <20180918152923.24824-5-lbloch@janustech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180918152923.24824-1-lbloch@janustech.com> References: <20180918152923.24824-1-lbloch@janustech.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [141.226.29.227] X-ClientProxiedBy: AM5PR0701CA0016.eurprd07.prod.outlook.com (2603:10a6:203:51::26) To CO2PR07MB2614.namprd07.prod.outlook.com (2603:10b6:102:14::9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5770dafc-c30f-43aa-5786-08d61d7b9fdb 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:CO2PR07MB2614; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2614; 3:js+G5Q8Xedsy2/dLu3k70QUq2dQagMV1gLscAjmIF6Lab0XpmApwMXqT22N0mLXs3LexM7C8kMnw5MzI+iQJqVEb10sbSBuKlnhh+OytKIF9W630esSaqRf17fRiEqTR/v3MOBVEDYjymDxoEVx6PS1KlaRyBhEwGYgIk+BhdwOFk+wLp3RlvokNXE+POufS1JK34ssS5JyAUAtKvy+Znv9epfwDCgC98GC//M10MS7wBTbwIsiXQsLBet5zNQWX; 25:TRcVSTM9zJnamjcAspAGt3cUrM/BcA11JLoM8GnUHHQbywjdMZWsfwBz+2BL6bMLav5v8Up5X136Z/KSRXrghTdSKvZpcO3NJlRK0qgK9PIQXVyadVacqqg/zFtEamQapxI3GUlNL3TTCc7NwBkeM39AZ3MeLnv3WRm/9OTnlNbTKJSmPFbr+BmcItk9zPAyN2L0oH//kLdt0n5EEelYp/HWPCx7Z1ooJiBrYm7FmHlpfgrd07REyq2cRtbkfwqgLLNnArKuChdxj5XXQ+UVXJ++kB/CUKbF6IM8VX8GzpVY1rmuLvjU/c+/FpRnMXc1rERlgFn8iDxzvbOBu2DYjw==; 31:nCAFwi95nZJTs0cZstoeX/IFigqPRUyepd1v1Iy/ThZpZZuubtJe4r9ZkjRc0CLuTwnhy8cWCQsNcpSx8oWGB3qelxMOoir1PEMsIOE9Lu710PvfW1Mv3qNZzI7zwWVwZlfLOSb3Ikh+5QeZIKn7Wmc09C7oZ228uGg9xJ2L9E1Bz++GGSHkNPjiQG5zWwTNnMB1wrsFQttT/YjsuCGlog3l2/cR4ot7K4LZnkgeUCY= X-MS-TrafficTypeDiagnostic: CO2PR07MB2614: X-Microsoft-Antispam-PRVS: <CO2PR07MB26146B10F5E8278F2B300FEACA1D0@CO2PR07MB2614.namprd07.prod.outlook.com> 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)(93006095)(93001095)(3002001)(3231355)(944501410)(52105095)(10201501046)(149027)(150027)(6041310)(20161123560045)(20161123562045)(20161123558120)(2016111802025)(20161123564045)(6043046)(201708071742011)(7699050); SRVR:CO2PR07MB2614; BCL:0; PCL:0; RULEID:; SRVR:CO2PR07MB2614; X-Microsoft-Exchange-Diagnostics: 1; CO2PR07MB2614; 4:zXbweIHV0JuHwKS1olpbeKiGn3DR9cBphR3VRcMv++6wJ9lTEef4Irr0dVdnpoaBKi47Xh9l1n63FNK0Pkt7NsqIiQ3YHJOcE7wwfcdF1rqAMmRYIBH7VPZlyf10Zr53nMUb/OTBk/5eJzaSK+JaIVVSB/3agKtigyjzYo8P7fYX+ulVOQ4s/81w/Iy0NwtuzIxDLEAx6+UE4zRZffThd2jNIwKMU5yDhE+8l5p6bFDrMtiPY+Id/HyniEaJf+effS3J4khE3dKVpr3iWmKFaQ== X-Forefront-PRVS: 0799B1B2D7 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(136003)(39830400003)(366004)(376002)(396003)(346002)(199004)(189003)(386003)(956004)(47776003)(36756003)(66066001)(14444005)(68736007)(53936002)(5660300001)(6916009)(486006)(6486002)(8676002)(305945005)(8936002)(81166006)(81156014)(16586007)(54906003)(16526019)(446003)(476003)(316002)(11346002)(2616005)(186003)(6116002)(6512007)(7736002)(105586002)(52116002)(50466002)(86362001)(575784001)(76176011)(26005)(6506007)(97736004)(106356001)(50226002)(25786009)(48376002)(4326008)(107886003)(2351001)(2361001)(3846002)(508600001)(51416003)(2906002)(1076002); DIR:OUT; SFP:1102; SCL:1; SRVR:CO2PR07MB2614; 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; CO2PR07MB2614; 23:55V1Ir0SNmnAqTqdVr1NZ3Xvsst2Z2Sa+epEG55Pd?= ik/KiWgouHbveYU/qnrp4hDvDMEabmzsG1RFtvESQ1sDlZ3XuQcPOhk6ZAM+adskS+JeTaNlqbDbImur6dAuHA9HsG1s1kddKCxAzWDx9hkLhNouMscoLBG8F/bxuNxAfwOAwiMerkEXQ3unxoXStOM6cUuORyPSX3HvF1sqMCZMOiWiUdAUIB4Vv0HanXZgK/fY6pcgmK71B960vsPHFotfSXemTyISV3QLmO+JhkbvFvbelRdWN5WJcNGGNYZhOuDtUG4GOZHmAElE+p0Zc+zwH2YXQ1zx7zFcfkKn6JGnPWJCQzBvEJY990JxdY/OOiTplVstCmx9qpbwdQOU5OtcuFtwMywyXJ1vXA5lDwMUjwdQ4OhLJUVFHVmHDBM2kxVHJHey0VWjSTgVp4GPLKA9is2jnBq+eWOwKL+rsnz07Enadei4BPUX7F+AwFJxUsYQSfZbbFUJH4iCYliWpzuSFlptZzD3vkaXtEMqPG2sAsKZnKuwa2JZFPSSCYFmPEKfF26yUWk1hDLVAv3eBjcVR7LtvQP2ybSqSELlJCKLqxONObgZgI6tDmHHyOl5D/fMKBkjXIF+MOHw59tyzrgu/6TJM5AzbJsD1+ozbZxDT+Hc4uu7JnyBYV/LPBPqNGW2/lR68qhY30No/GCeSXaJ6ycI1BdowhIFda6UaQHgC1TxbHmG25QMszJBXJ1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QWgCigHiEd5IRcsJSlvr4+zkrvj0vjRJQ0/dvhUKgk1W/5KIqEW/bxaaju3Z63ikboC6CJqGAI7WZ7v7ilgKnYrbWtZjzt/1huYcGw8NmfMtXEIMNRSyaxuXCB0L0m9nWPJKLKGDYq0ABesn1/FrtXVU2yAZ6l2BcTR6aU8pAiHnEKSqxGu5skh3s0KQTbd7jj+DF+FRMKNXDEIWA5rBRtnKU/U4TY+ZpMkLUqcPW8CzkX/jM/18MmB6kg68ghmjDKTrcld5uQ5s76IP049OwyoXn1qAiBMnQIuU7kqc/eUDSfR1vj0xufgTgdIj0jnb4HsPdZEdvwL0tjN5RH2C8lkvQcV4uhosq/r3Bg==; 5:gYuxXLPPmunuk2mB7ufmjmk71BygiVLJ0iwQ9PLUXFINI972TxuGD7DVYIOs0snO0MjSymn6T4mTFkV6UFFNfmCUyh3ToIPFwF5Vh0zBA5Rgot0UEFI8hJBD6JuOIvkF0reFnI96btNe0oaiW4nrI1N+RH8n2c0EMyXaFTk4dJY=; 7:FYZksN+vCqzmJlDwclcT0JHrzEDQhfXGd/fNY4AZH1xjrn4r/QPBS1y7KJCcmnNtrJ6M/33MXJJsdKpQa5bv2DAgu/E2WiL81OxnCQZlLdGy2f8svAzzdbIpNG9b+QDoaAa5USC8Eu4R4s2URlnOmKpT7+5Rt4kzbIlbnXz5+NAPf2ONXbv85Y8ZhBBbLdTd8hlim9ePEy4mTcjr5AGpA6nP8MxCkOckqNBy/GxJdiVC9n5o2E4qtln1heIz2wro SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: janustech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2018 15:30:10.0182 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5770dafc-c30f-43aa-5786-08d61d7b9fdb X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 34eb020e-3cf3-43a1-afeb-f5cf1310628e X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO2PR07MB2614 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.32.107 Subject: [Qemu-devel] [PATCH v9 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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel/> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: Kevin Wolf <kwolf@redhat.com>, Alberto Garcia <berto@igalia.com>, qemu-block@nongnu.org, Max Reitz <mreitz@redhat.com>, Leonid Bloch <lbloch@janustech.com> Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
Take the image size into account when allocating the L2 cache
|
expand
|
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 ||