Message ID | 20180807202122.27006-6-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 CDA14157D for <patchwork-qemu-devel@patchwork.kernel.org>; Tue, 7 Aug 2018 20:23:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BD33628E09 for <patchwork-qemu-devel@patchwork.kernel.org>; Tue, 7 Aug 2018 20:23:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B193E2A6B5; Tue, 7 Aug 2018 20:23:58 +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 4A02628E09 for <patchwork-qemu-devel@patchwork.kernel.org>; Tue, 7 Aug 2018 20:23:58 +0000 (UTC) Received: from localhost ([::1]:40708 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 1fn8WL-0001YA-EZ for patchwork-qemu-devel@patchwork.kernel.org; Tue, 07 Aug 2018 16:23:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47178) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <lbloch@janustech.com>) id 1fn8Ul-0000Dx-8J for qemu-devel@nongnu.org; Tue, 07 Aug 2018 16:22:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <lbloch@janustech.com>) id 1fn8Uh-0008AZ-OP for qemu-devel@nongnu.org; Tue, 07 Aug 2018 16:22:19 -0400 Received: from mail-by2nam05on072c.outbound.protection.outlook.com ([2a01:111:f400:fe52::72c]:22811 helo=NAM05-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 <lbloch@janustech.com>) id 1fn8Uh-00086y-Fq; Tue, 07 Aug 2018 16:22:15 -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=u7R0mDv/oqXjyp4/c8DRsrMkN8ni4Y1myVPwCrkEqdE=; b=O+v7IcLCEROuOEOhCdQQunTZiMVbPpJ/2s/FxFmMJeBvEx87wgsUXpqnhbw5O4arxGkXaPSh3chnqEzIDX/d03S0W5jVjchlg7q/jG6rf3sgVm9OX9JN845mYmMt6Ho+luxux3By3apbSwLNUa13HilWjKSQr3smA/SuwZiBSOs= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=lbloch@janustech.com; Received: from Jupiter.local (141.226.29.227) by BN3PR07MB2609.namprd07.prod.outlook.com (2a01:111:e400:c5f0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Tue, 7 Aug 2018 20:21:56 +0000 From: Leonid Bloch <lbloch@janustech.com> To: qemu-devel@nongnu.org Date: Tue, 7 Aug 2018 23:21:22 +0300 Message-Id: <20180807202122.27006-6-lbloch@janustech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180807202122.27006-1-lbloch@janustech.com> References: <20180807202122.27006-1-lbloch@janustech.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [141.226.29.227] X-ClientProxiedBy: VI1PR08CA0126.eurprd08.prod.outlook.com (2603:10a6:800:d4::28) To BN3PR07MB2609.namprd07.prod.outlook.com (2a01:111:e400:c5f0::13) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: aa69cb4e-15cf-4526-29d5-08d5fca36cb9 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:BN3PR07MB2609; X-Microsoft-Exchange-Diagnostics: 1; BN3PR07MB2609; 3:Fb411odVDE4bnhhujXFLFKRG/DWRjjiEWZcLhMFMiJ65GfhzLdgRdh97Dd9vpFoBfZAuss7Ae3NffzUOyfMmX4OjHEmEqzF1K8IwUSnu1FKYiARANMO8PeG9eSJhRMHQxlcWeYUhuWWhkgzRby+307VOrJVdqPN7mx21s8F/lICswUmeNzB5/utun4IZWIjxebuvtRURZp79XhSaj2AJfzl6lx0KC6H98Ef8F/aYJL4pmsrFR8+DC0ntv4Ry8hwY; 25:NSvlcdpC7Ge0ZgrdfWnzElj806A/gddGvRexGXop/jP0VFU2IVH73Lw/2mvXjFvdohMogRgLKFweX3TqXWXNpK6Z1cL5slA8QHv5OtiTIyw8bKVGeuomXZPeYCjcFT4p9tnhnUnra9HAVuljvOPxvLfvmETHB7cAvS8E1Tw3x10CUbRT7a3FgvIUNRQMuY3hrNN+Qr0OGQaB7IXO4teL5V9cKcE8JvfMPOLZWvof7MPzUUbLYgDXXaaAfBhW11TBJNaurWXlr+emNjPKqGPh+6ENk2mDihvrbFVpxXMTFDI+FXE+OBtsbmYjF17lO0UleddJGbLLZTmQtpIZrbTzUw==; 31:DlSwgy/PHpkMeNQHvo1/nH7SxaAX9suXqt0TUDCKYj1qc4QA+NwwZ/0vQH2mStbPVXI1SJKIMzT2sDIt3pS7dCBE4aitK2rX11NmaJPeVJaMaKpOo7WfS2FtQ5X3o9jp9EJuQ7dY/MWVh1WFeyaX9mjGpwtvQ7dKHP9DwW+zRmS4IQxqvKIlac/+NI8QBdbROpSy7RHwBwq0KeuYj3xakun0TNFAbnvA0EL/EkI1dfE= X-MS-TrafficTypeDiagnostic: BN3PR07MB2609: X-Microsoft-Antispam-PRVS: <BN3PR07MB2609015C02A4D9F4DE4BE1F1CA270@BN3PR07MB2609.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)(3002001)(10201501046)(3231311)(944501410)(52105095)(93006095)(93001095)(149027)(150027)(6041310)(20161123558120)(20161123560045)(20161123562045)(2016111802025)(20161123564045)(6072148)(6043046)(201708071742011)(7699016); SRVR:BN3PR07MB2609; BCL:0; PCL:0; RULEID:; SRVR:BN3PR07MB2609; X-Microsoft-Exchange-Diagnostics: 1; BN3PR07MB2609; 4:pktNFu6xfzo/jw3Ecko8eYwPUN3GVL7vr3njyD87uPEoNcALx1UeC++jWGwsseHpilWYa5qCR8x0sLhl/JYZnqljdRL044xdkMLr0o41gddJh1TshPsfJrMt4ATS/nA34agpCfrIq90w146GfXjtoyHOQ0nFrjHSLors+F2SHX942Dc95LVkUDBTkT0mRZy3hu/4QAMCxHcWV1dCRpopL93nVbIlm7jJeK92RCZFlQzsKpLYuf+9lzWDcyXiBEBr1/Tc50nifvd6TxK+lMGmCQ== X-Forefront-PRVS: 0757EEBDCA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(396003)(39830400003)(376002)(136003)(346002)(366004)(199004)(189003)(47776003)(446003)(66066001)(956004)(305945005)(11346002)(105586002)(48376002)(76176011)(486006)(50466002)(106356001)(7736002)(5660300001)(2616005)(25786009)(52116002)(2361001)(51416003)(2351001)(6916009)(81156014)(81166006)(6666003)(476003)(36756003)(386003)(6506007)(8676002)(8936002)(16526019)(50226002)(16586007)(26005)(54906003)(316002)(68736007)(186003)(6512007)(3846002)(6116002)(6486002)(97736004)(1076002)(2906002)(14444005)(53936002)(4326008)(107886003)(86362001)(478600001); DIR:OUT; SFP:1102; SCL:1; SRVR:BN3PR07MB2609; 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; BN3PR07MB2609; 23:VsAY+BmKGDpgeeUAfWYhop1/xmpaEiAWinDRDIbrU?= EgJrDWR1OwfKGyAiPp4B2LUbqbtql5pdBk0kbW8QqsnOfRha1BhqraQ4V6t+I0kL+f0Dd39zPWMMFOwkedSDRVSAPCNpB2QnF+T85yGeV7z34rAzjD4iqtbZYYo6unWA8VEDRwB5GMoeqscCApkZNYYQW5pcl/Hr9FAZnm6PFwohigt0IrlH2mkwNOM8iUvYR/Sc9cAYLPNGntIA2/oPBZclX6FfvD9YE29dWPR+75FfrqypJ9Oy8LYeuCTg8obFI9B2Pz5BY/HsPM//07LQt1RkU+Exvw10oOMQgZHVHuBDO2PHQxvPEIgiXrprjBcIHP9FOV1MGE6FTFwLxn2WyAZdqxDaxHeoO4kiijiRr0bnh9PCP1Qv7IubZPOnkg0MZ4R2IV82XsHg1gtuF0aHL+ejbnW+PAuJAqG4cUzx1D4pvebd5FPunT0KpQjArajFb10eGF3KScaW7GgDYCxWpxGUrsLzHOIlljpEKbJ0R673MMX2LeMb968UmIZg3CsJtZyobsbGsCovSlT0z+O/U2dvFLYJbcgDO5/fnRtXm8fuqAAeUeZXMnHA/m4YoT9auDhRbBxp9d/0U5DBf7uSS49S7zMlU4USJuIffDZt76jZrhSrDEIw72vmp1PQaKRgdwmk1KOXUF36sD7jO3phkc3qRYz9sHF5cr/+aAaxW6igQCbWLFkElhtNp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Wk2XIRzQWEtikFZj6YtD42WUX1aCNS0aX44E6WFCR8nqHWZRkYE4MnOc+dWOMlI39KPc//8yrbXVHG9Z5yFVgSFxmnYxJf3aE5BfHwR3nhfnZISG+FMHu488L7oZ5vXXVjxQPjIm3OJt8ZRhQdDSdj9mIBWyec/OFNY/1PfcW6JFQNm3TZWhfWjHlz3w+JO866b+YIz7jixYbvp6uZzQux8WDRTMmG6p32eImN/fiDEIuyBl9k3uyrlyKOM3WLwJgn/Wh6mXrcGb/q7RADehcvJqyUx4Oo/Lmy2DL1HCqdDQg8jHDX8yab/6D07Cbs2BY4K/hYAbAJIKnm4da/1DFXJx38oTiqftj06OfEKwigSRLybj4AQKN/hA==; 5:g67FFdtH+heBskswgjKEVxDqKeJLyGY86ugsyRYGZ1Y6fnyhs/d5ONFbPWhqCakztq8vaNpcnIOWaaTYnR5bXpKtU8seRGEEIcZfSPlcPtJAF7+MZTwitGJ8FAMuf917l6Khah87/Kgn5lBNMFgHXGrKvrQTYp+Yd1Ct4WTEDe4=; 7:5i3dvSuWFKwIQybVsHQ6Z1FQAZJEvehQY5txeeQcWQ5dcSadnd5CvBvLbS1KQ6MK8DyUudbOOhO6K9Q2RZQvSsOvtrqqzpxX2ZMNkkEF24FrNxgblW8tjnzwQCbBpybUDT/7RB+YhgEzq1tPlnaraMYwtHCubBwLgdfnoqiXH3Qn5aecKe5iiGPmX66qVVQnufzFbflC778HlB0n8gyY6VyhKFoJdvfdR1dXP4Ydvo4X700PX6NqUX9M4ewLijMi SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: janustech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Aug 2018 20:21:56.1273 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aa69cb4e-15cf-4526-29d5-08d5fca36cb9 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 34eb020e-3cf3-43a1-afeb-f5cf1310628e X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR07MB2609 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 2a01:111:f400:fe52::72c Subject: [Qemu-devel] [PATCH v2 5/5] qcow2: Explicit number replaced by a constant 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 |
qcow2: Make the L2 cache cover the whole image by default
|
expand
|
diff --git a/block/qcow2.c b/block/qcow2.c index 453a6377ac..a54e20402b 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -1321,7 +1321,7 @@ static int coroutine_fn qcow2_do_open(BlockDriverState *bs, QDict *options, /* 2^(s->refcount_order - 3) is the refcount width in bytes */ s->refcount_block_bits = s->cluster_bits - (s->refcount_order - 3); s->refcount_block_size = 1 << s->refcount_block_bits; - bs->total_sectors = header.size / 512; + bs->total_sectors = header.size / BDRV_SECTOR_SIZE; s->csize_shift = (62 - (s->cluster_bits - 8)); s->csize_mask = (1 << (s->cluster_bits - 8)) - 1; s->cluster_offset_mask = (1LL << s->csize_shift) - 1; @@ -3446,7 +3446,7 @@ static int coroutine_fn qcow2_co_truncate(BlockDriverState *bs, int64_t offset, goto fail; } - old_length = bs->total_sectors * 512; + old_length = bs->total_sectors * BDRV_SECTOR_SIZE; new_l1_size = size_to_l1(s, offset); if (offset < old_length) {
Signed-off-by: Leonid Bloch <lbloch@janustech.com> --- block/qcow2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)