From patchwork Fri Aug 10 06:26:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonid Bloch X-Patchwork-Id: 10562265 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 A7365174A for ; Fri, 10 Aug 2018 06:28:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 962C42B3CC for ; Fri, 10 Aug 2018 06:28:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A3C12B41F; Fri, 10 Aug 2018 06:28:42 +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 1B8B62B3CC for ; Fri, 10 Aug 2018 06:28:42 +0000 (UTC) Received: from localhost ([::1]:54542 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fo0ue-0007mh-ST for patchwork-qemu-devel@patchwork.kernel.org; Fri, 10 Aug 2018 02:28:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49380) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fo0tR-0006jh-Rd for qemu-devel@nongnu.org; Fri, 10 Aug 2018 02:27:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fo0tP-0001bM-8S for qemu-devel@nongnu.org; Fri, 10 Aug 2018 02:27:25 -0400 Received: from mail-by2nam01on0100.outbound.protection.outlook.com ([104.47.34.100]:26496 helo=NAM01-BY2-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 1fo0tO-0001a8-UI; Fri, 10 Aug 2018 02:27:23 -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=RLbPvh6ml+sdi7+vkh/qiPcJVZJhttLkt69wrdChoLo=; b=mW+dI8L7OepOF3XzRYY35IuGAL9ceFuQhIucX/9j+Klf7/EbIhCwsce0QW476n/WSSEhIsVYIOxhwViZf2JbhKwNyWwnqW/wZIE5jN/iJlgCXwXQXbTcEWuKidzsGb/5T0oq5WT4LZXvHL895pfxet8IEzrt+zoZBm6qYlLRFMQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=lbloch@janustech.com; Received: from Jupiter.local (141.226.29.227) by SN2PR07MB2623.namprd07.prod.outlook.com (2603:10b6:804:8::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1038.21; Fri, 10 Aug 2018 06:27:18 +0000 From: Leonid Bloch To: qemu-devel@nongnu.org Date: Fri, 10 Aug 2018 09:26:40 +0300 Message-Id: <20180810062647.23211-3-lbloch@janustech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180810062647.23211-1-lbloch@janustech.com> References: <20180810062647.23211-1-lbloch@janustech.com> MIME-Version: 1.0 X-Originating-IP: [141.226.29.227] X-ClientProxiedBy: HE1PR05CA0232.eurprd05.prod.outlook.com (2603:10a6:3:fa::32) To SN2PR07MB2623.namprd07.prod.outlook.com (2603:10b6:804:8::7) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7e5ccf71-4b43-4609-038d-08d5fe8a53cf X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(7021125)(8989117)(4534165)(7022125)(4603075)(4627221)(201702281549075)(8990107)(7048125)(7024125)(7027125)(7028125)(7023125)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:SN2PR07MB2623; X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2623; 3:DhJXAipoQt1fdp4g8orI0sZtDalcuqHiO+aAMcvn83csjJBvz22odZep3UgWMtU2F5F17blu+WCpJf77dckKxgw5MV0qPTu7nv2UrRADrzN+8yf4LwA1bgiLjljLpTLdbIsuWQcxT1igeOuR6FiaNT2Xhr01SRcn/Mmto+wkZVC0vfzL/iXiXGDE6JjAOCXWC+w4Gx+MuFZmf2ZiaoRFGglO6B0ZOpAqlE0fcGV7fMLteDWfarPGtW8/OwrnLsI3; 25:4jyBuTlaB/qSE6BjlmG2oBggTcdAuMSESxayRvgClo6Er1kVsKN89Ue78UIZPJcbouTwJw2ref3N2W0fYQ+vLQJSZCKFbDJ6ZZhGISb+HiN9yWGepcJwbxQmFksy9aV/7ozEgVk7YTo2pnL+aq2M1wvVsGsCbjveoaAA8ZywM30ZJoGyb4v65doY5QytdJsiT32tTKHXjCHJ1NeE1HdtKxI5+0uijGszKkdSyU+wxKJVKUQZ+7fp0IZj7ENFQrr5x5v1hwjjqgIFQCO7FqgjqtxHiiQqvKAtMd9Zia0mUWv47BlsEx4LjjZiCXf32VrgpgAmnLb1GRHIhwi6qKJYCg==; 31:efQlF4cJpLv/m0hIfL7VkgAlJGilrWlhK3LXHEDQOrHdF3wXJ6dUnsrqvv1V0k70EBI9OhE+E5mkvd6/+t8fpMOFiBauccIKdWjdt8HeiA4GiStVQ2OLEx8+rz1mYcG9lRe5YZs7KNxvMKRgXlEOywBBzPRaOp9uZRpKRuw/Ly/nhw2FVd5WmlV+8tm7mlJRP1kJNsrNt9sfDW8q3qqvVLUnkTw951rZcHykhtwxBSM= X-MS-TrafficTypeDiagnostic: SN2PR07MB2623: 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)(3002001)(10201501046)(3231311)(944501410)(52105095)(93006095)(93001095)(149027)(150027)(6041310)(2016111802025)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6043046)(6072148)(201708071742011)(7699016); SRVR:SN2PR07MB2623; BCL:0; PCL:0; RULEID:; SRVR:SN2PR07MB2623; X-Microsoft-Exchange-Diagnostics: 1; SN2PR07MB2623; 4:FzcqDPJkpDrJaXI98GRZ+cCGOsvd+F3nguFvembqu3c+2tcKDqG0cjwEC1j3qXqMnRDIcnB/fHYf3MF5E8zvmHN5PBe0tKMqXnOqAInlhiQfMJo3/x14xGKdRxY7zPj8RLUIZCIMmP2j9tSiFPDA0yowqMxNAMPEEL6IEnpYkRs6DGmAibXp5SaEkoVUNghGB/BMgjUr+wHLDKJsEZoxkswC4P8ybrpo69Ngqr5KxkBnq3uVHNVxDWNjuThXx8GJQqLuDX4y7tGJHT9s/dvj9g== X-Forefront-PRVS: 07607ED19A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(39830400003)(366004)(396003)(346002)(136003)(376002)(199004)(189003)(36756003)(2361001)(68736007)(47776003)(107886003)(105586002)(4326008)(5660300001)(186003)(106356001)(16586007)(2351001)(6506007)(316002)(26005)(76176011)(16526019)(86362001)(6916009)(54906003)(6666003)(386003)(25786009)(478600001)(11346002)(6116002)(8676002)(3846002)(81166006)(50466002)(2906002)(81156014)(2616005)(53936002)(51416003)(446003)(48376002)(6486002)(66066001)(486006)(7736002)(476003)(305945005)(52116002)(50226002)(97736004)(1076002)(956004)(8936002)(6512007); DIR:OUT; SFP:1102; SCL:1; SRVR:SN2PR07MB2623; 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; SN2PR07MB2623; 23:hGP+ltMcCE2+1dSBE4Zo2yqjUJGYUL4jyNGU4SqLX?= MagLy/4jxQdeuwDbBJqoq8Ou3qoWoXcWee3BzMfXUpO8TbqoHdxCYn3VCIvb21PwtG1ejBWNk6Y1lZXrFxOQ/yRwKbjI90xL1T2oBzcY+RHDqbhvepnW/qOCeCFBNW96npyR+WwWnVlKUQeHySkyOotLXc5D+RpzM08f6hbaI2+fgOrmt3TQQs0h5zHtMlp1tpZIRGWb5Gqkk80oCCh1onwvnCg8NExnjoPcMGGdHpIGEvotnV+8XmCn3S21n2m6IeqLtLpVZ6fgdedCGt9BauUTO8zBfDcyXd0T7gUgHDaZqW2/0V8Vf+ehZ+1CcHbfjZKlqU1fouCN7jZ3XYar80lXeDjSAKX3iGzb7MJBjwqefYHES/t15A2eEn90m7p6CJGGEEWF5EgWWtFPEnj91XKyAglT6KOqk+1V4PmXWOgNb/Ofu7cfChZYSmkEheEzrxr8jg807tXlN65fFT8Ib0GIbsm+o/muATPAOqONNdjDNlB16h1KUlvOhE0A1wl9cNnCpyMVgyyqNyizTkJW1amcaDETAkNFYPsflJJezmDZ7y3AbEg91dJp6MUZ0MGet2PHmTI851JAxSfc0YScwbwMEcFG/aveSVJEMBBWjrLxfCI5fck6DzGOCwIIEBpO5OnYsUhP5Yd+g5c1LF+j2zTLL0M/BaJqdfZs/s7f4OKQIXTBPXoVUUoyzZVRvlg73gSEPsqC6pvj/WUL2ehT8y9InMrHKEgj4RtdVNZVyKs9T2dN95iRlXvjlG7UkGtIoBxzDeKKmruK3hU9DvaU5b9mTL8qR5njVt8wE/1BZPexTjHt4yFSlS/K9spKWibk0iDt4PMOglDIpEowVKfWzPoUiIOeBUq5FKEOH02H/aks8HxtjF/v4AL2pvCoLeSxtDYVFzoL3+azm8GF0YzlFaR/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HB8Z3faHQd+iKAfxMI7UGmRSzI/z5vN6+SesAzhfvbvhU0afC8Av1jSDAe8TSuj/uulFrOUMnvlEDA/3PDpIOCaFm+C7+AChX6REk85ptRoXEPERZsW6pD3m+qAJc/ZQ==; 5:9W1SvdDzmgV00it9pNbDDdGpeWS7u4nFlE116ih5VqnGhIEjBWxfDMua8QYzUAbEMsLc0oXNQ1gAh71JQ6XkZfYujvEMYK0gMCZ6+g++/CMSEoMkGeVcXdxopX8v89TmX1QV8CJJ7LwzRbs7wzRapz+TuEFNRst1bGQzUItJPu4=; 7:RargmAuBHN8y6q8+uina8E+xABWephV47yTAE3Y0PtGvWDC3zlKhihksAGuWNlV+0PI2UYv8Ah+JNVwsSWD7MEPCCByzkx9+c+FK0ctAM6LJhWOAFU0uxJcURGDxxocI576F061v83sHlOjK0RlnyWbabqzs/AJk2k6AOMCOwkxg2eXpCUXERkCKosmtcHpnj5W121JAYjFbKlEsurcbT1TVeUaQ2sHL49xqdAACRrwKenupkI97WPa2VMonk93c SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: janustech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2018 06:27:18.4842 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7e5ccf71-4b43-4609-038d-08d5fe8a53cf X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 34eb020e-3cf3-43a1-afeb-f5cf1310628e X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR07MB2623 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.34.100 Subject: [Qemu-devel] [PATCH v7 2/9] qcow2: Cosmetic changes 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 Some refactoring for better readability is done here. Signed-off-by: Leonid Bloch --- block/qcow2.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/block/qcow2.c b/block/qcow2.c index ec9e6238a0..3f4abc394e 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -790,8 +790,9 @@ static void read_cache_sizes(BlockDriverState *bs, QemuOpts *opts, *refcount_cache_size = qemu_opt_get_size(opts, QCOW2_OPT_REFCOUNT_CACHE_SIZE, 0); - *l2_cache_entry_size = qemu_opt_get_size( - opts, QCOW2_OPT_L2_CACHE_ENTRY_SIZE, s->cluster_size); + *l2_cache_entry_size = qemu_opt_get_size(opts, + QCOW2_OPT_L2_CACHE_ENTRY_SIZE, + s->cluster_size); if (combined_cache_size_set) { if (l2_cache_size_set && refcount_cache_size_set) { @@ -823,8 +824,8 @@ static void read_cache_sizes(BlockDriverState *bs, QemuOpts *opts, *l2_cache_size = max_l2_cache; *refcount_cache_size = combined_cache_size - *l2_cache_size; } else { - *refcount_cache_size = - MIN(combined_cache_size, min_refcount_cache); + *refcount_cache_size = MIN(combined_cache_size, + min_refcount_cache); *l2_cache_size = combined_cache_size - *refcount_cache_size; } }