Message ID | 20180808071051.30628-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 DE87414E5 for <patchwork-qemu-devel@patchwork.kernel.org>; Wed, 8 Aug 2018 07:15:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C78CF28A35 for <patchwork-qemu-devel@patchwork.kernel.org>; Wed, 8 Aug 2018 07:15:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BB90C28AA5; Wed, 8 Aug 2018 07:15:25 +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 5440F28A35 for <patchwork-qemu-devel@patchwork.kernel.org>; Wed, 8 Aug 2018 07:15:25 +0000 (UTC) Received: from localhost ([::1]:42149 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 1fnIgm-0007R5-Gd for patchwork-qemu-devel@patchwork.kernel.org; Wed, 08 Aug 2018 03:15:24 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47147) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <lbloch@janustech.com>) id 1fnId8-00047e-H4 for qemu-devel@nongnu.org; Wed, 08 Aug 2018 03:11:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <lbloch@janustech.com>) id 1fnId5-0003De-8A for qemu-devel@nongnu.org; Wed, 08 Aug 2018 03:11:38 -0400 Received: from mail-eopbgr700110.outbound.protection.outlook.com ([40.107.70.110]:16032 helo=NAM04-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 1fnId4-0003Cy-VI; Wed, 08 Aug 2018 03:11:35 -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=nuz1nNx1eZqA6ghLkqXXyVlSl4ESH/DjfU75XS/MhGi9tjLnvWVAr2FPeX6/tcR56wwh/t7l2USXnYMPCiBZwdW96g/OZMUvwQERn/86IoP5uisyvVEOUDDNJ5t2pnSjGDW3Ps6b2TDC3+Xk0QFgHkzdEHrE2625BCJDy4lQi9g= 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.1017.15; Wed, 8 Aug 2018 07:11:31 +0000 From: Leonid Bloch <lbloch@janustech.com> To: qemu-devel@nongnu.org Date: Wed, 8 Aug 2018 10:10:51 +0300 Message-Id: <20180808071051.30628-6-lbloch@janustech.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180808071051.30628-1-lbloch@janustech.com> References: <20180808071051.30628-1-lbloch@janustech.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [141.226.29.227] X-ClientProxiedBy: AM5PR0102CA0003.eurprd01.prod.exchangelabs.com (2603:10a6:206::16) To CY1PR07MB2617.namprd07.prod.outlook.com (2a01:111:e400:c637::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 72cbf5b9-6407-4074-339d-08d5fcfe2bce 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:CY1PR07MB2617; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2617; 3:FV9nKgmbwdiT9oTREipywOg427OSDRmfTOcTjPX6a7AEYpC0SwhRxFvCoYF7YL0d+pyrRH0iM259ktfJIL+fJt7UQlBfv/YXPp/UK9NG2CFASJk63dl1ZBC0/TF5JhpPA3CBkBgOBwiaJ9JtuYUUiKWfVogZimbpPfknbHIM+L6dg6IHLKG+NqhXY5fZ3cgCsGzqvXbcGKSXaz6/bcbGzXaPUj6WCrkwyZWJ5Nm1hMV6LowJNUtM1CoIlOXRPn2P; 25:hvHQmKqMwh9FrXk/4x4VRdDENR8++OQE+VE+SEpTYynTnGkO9CX1LWj3mW6hhG+CNnWcGc2MgPTa/+5EllfwmaoycuP/TQySuuiSVArQBIQUI+LFgsJ0rXmnqN8On9s3UyCgAIvr+y0Rp/yo71Zy3shHd7ScWftS7YvUfY5BKIedU9ncMU8Y/dVe2DfRvdVejy697KS4iyIHWnlvPZiU0ph1R49bSmP2GPd6W2HURNx+mpgEJ5HZ0/BSK1xlbTTLNKkavhzL+As6AZV725Bj09dUD62IDq0EBmFyQ3P77XhPurigtNTwZd1SfFQmot5HYqa0/pKpuwFYWRKVXy2XyA==; 31:ygpqH2NneWTLViPzV3CV8Q3h578T3Xe/Cx2Lq2huO5UHadU59B/hkdLM337Gy4P7NHTGeKiRmjjZWkww3rtI1eJsDr7mlFP0REb5PsZOS2x3Gw+n/+j36aaGRF0BswCvtj+1f8loEAmiJYRoyTN4D5HndWj35ZRwaofxvo5vBm1Ux8vmN9kK+tot3TaWLGkdB6inObMt5J2nENBoB0HCuuzlmJkMsSv7x7UUi0Ybu0Q= X-MS-TrafficTypeDiagnostic: CY1PR07MB2617: X-Microsoft-Antispam-PRVS: <CY1PR07MB2617560A604BBAC810708701CA260@CY1PR07MB2617.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)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231311)(944501410)(52105095)(3002001)(149027)(150027)(6041310)(20161123558120)(2016111802025)(20161123560045)(20161123564045)(20161123562045)(6072148)(6043046)(201708071742011)(7699016); SRVR:CY1PR07MB2617; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2617; X-Microsoft-Exchange-Diagnostics: 1; CY1PR07MB2617; 4:rQjlgsPYYH8emFPTnFdBzJGDu2JLFVvpHOmw6SevTp4NOIHhVriRRQuBDfwUl5q3n0uy4g8AR9+w2lyZdMTeW68OH96rNo+S72KNNFbd5BWLVqJiB/F8QDaqNpYY4kYs2eaKWarfyeXKQkUvOCi2ejv6rupdeAlsTlx3vZbNwnNRWe7bRRHaSnofI1EFdEYK6ENbGVlDDbO9h2+o6SLKRRzMGFrAEuoywEbjwaQzcgDMvAt+KRsWYYeICcgsun7xLiKeI8I/oQinUpUO11eKUA== X-Forefront-PRVS: 07584EDBCD X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(136003)(366004)(39830400003)(396003)(346002)(376002)(199004)(189003)(36756003)(6916009)(107886003)(6512007)(4326008)(186003)(53936002)(50226002)(25786009)(51416003)(81156014)(48376002)(6486002)(8936002)(50466002)(8676002)(68736007)(81166006)(52116002)(6666003)(2906002)(54906003)(97736004)(16526019)(105586002)(16586007)(86362001)(66066001)(305945005)(2361001)(2616005)(316002)(386003)(6506007)(2351001)(47776003)(106356001)(7736002)(76176011)(1076002)(11346002)(478600001)(26005)(956004)(486006)(476003)(6116002)(5660300001)(446003)(3846002)(14444005); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR07MB2617; 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; CY1PR07MB2617; 23:E0fRmd7Rd7CU9F+Pk1zwfKcTyqol8BG6r6NO6bJNp?= 53OjWXH454vCt1RwRXvgCbkyyc9iw4EVT09GxrJIx4E1XaDkXmcfVsYreJO/mUlbHVbF/H7OpKHySJ/25BBo6LR1Rzh9Bea4vyfNp6P6Bh3FUpPtaq7a1lq9M6Kp/AIR1UyiLKFaj9EINc50Bw4Rr+PvMR8Ff8vQtpvzJugnKQEFRCJikE3fwzlaFJbotCbE0Zq88n/S5nEZ20wS/J1TMdVVmpX2cSO7Xw3f8ZnIlcReYnXqeb/8ihnuxTOQkcUZYtAE9gi1/WtNSpJ0FwrGCXIqvpUd6HbxnOwIKUyTFm1r9SqH7GPS15O2fWorUzgQy9z+HPtxvJlTGRwodcXslxwCG9vs2QjTpHWPYdCWPKZSHYnSyT5eUVm7dwQAJ/vemzihF8euEbyi4QviU5z7PecZaJCiYMbDv3pHZa0Gh+Elu/EBDKyT8DwtK7dwIIF3T3NpXAhiytPph+Y4txoySZfCpkOSWeZc7rK97HywjRtIqnubvZ/cuwB2uyEsSup+k5j+IiQVWqYvHJcSlna8stRDoEvvzWq19NRmNJi5j877s6we/nCig9UIL4jHYKOq9jZHr2fdKloBPoJIkoSXdhTEpNxOd/Ve8tao0ioA42p+lFLjXreFPMqHgpXY2KhPjbyKCA6dRJlaXRgB0h4+iFjH0MeTbZUGsaiLBbl148n14xcjnJaB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kSeo/fczve8tyfaeJULFssqXJPUZmz9wl2tYUf8yhvE7QObRzpoQI9w9v/WOtnrxg9rkzyzsIZ1hj2jMsu72O39JQVKjUNSBPxgt7s4XSsCFu3VqOGY2GZ4Cx6fHZXOc7jiQOdZ8TmudCQgs/HRAxjfck1cwtKT5pTz4F4tPuxapu/kx7Qwbrp1SgplQtCSB4Xsfx0L3OFIvIgE06arUgLk/fXLVuZ6VaesSR2MbrSc/SlEMTvNejqKsDgGH3q8N9M4I3ErTeJWV3gCZuW3UzyOd3MGFUFdQKYFThh7j1YzcjNncl4xRzKzw/ZSqhOyPyMvrmFprixONIeji3vsZ+w5U5a0t+kiFahEbHyZCFUf8xswvpDjd2lH1w==; 5:r3gTkjSUuNAFuqQTmW/48c/kHWPHJo0oNSxbxniD0gnIaHSjpNXAY69Pyy6XD5zRfHJJVvR8bOAupVQpLeHnyQ9MRO9vG2Wsqmh8hMMTRCAfZpbFZQekkOMjm0l7QAIYJZP9NPYfr5px63hvNjnTjAcoF72Ap07Mml9AKFqd1mk=; 7:Au09e02QtFw0KCNbD9xOqUaVAo8ONMnDzzNR2dgU1kRY7dvFBuZuc8PwmmZrZpt/zlguOhtilkCaVD3BEjQo3Dv6EUl724ZQL+UIqLPzU2W3IiF8qYire/w9zjCRWVK8dVuwa5h/PgQSt1wutqaPwPvQcMdMTzZDMuEMrz+Nf6o8ZnHWIrTYC5Bk3A3PFSuzDYI0WSKWIm6kGx/iY2NGgrsXus/eMTHczkAIvEU7fwzrokCy5VN1kO919Z4IJMWq SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: janustech.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2018 07:11:31.1474 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 72cbf5b9-6407-4074-339d-08d5fcfe2bce 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: 40.107.70.110 Subject: [Qemu-devel] [PATCH v3 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
|
On Wed 08 Aug 2018 09:10:51 AM CEST, Leonid Bloch wrote: > Signed-off-by: Leonid Bloch <lbloch@janustech.com> Reviewed-by: Alberto Garcia <berto@igalia.com> Berto
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(-)