From patchwork Sat Nov 3 01:48:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonid Bloch X-Patchwork-Id: 10666451 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 CBE8914BD for ; Sat, 3 Nov 2018 02:03:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC9352B91B for ; Sat, 3 Nov 2018 02:03:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B121F2B95B; Sat, 3 Nov 2018 02:03: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.7 required=2.0 tests=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 46C9A2B91B for ; Sat, 3 Nov 2018 02:03:58 +0000 (UTC) Received: from localhost ([::1]:53945 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIlI5-0006JV-LO for patchwork-qemu-devel@patchwork.kernel.org; Fri, 02 Nov 2018 22:03:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53586) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIlFm-000482-5J for qemu-devel@nongnu.org; Fri, 02 Nov 2018 22:01:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gIl3b-0000It-1N for qemu-devel@nongnu.org; Fri, 02 Nov 2018 21:49:02 -0400 Received: from mail-by2nam03on0092.outbound.protection.outlook.com ([104.47.42.92]:61664 helo=NAM03-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 1gIl3a-0000HG-Kx; Fri, 02 Nov 2018 21:48:58 -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=ajp+ti9YE2f6vCdXgvUeXl1HZvz0N8mMwJ1XRl9hO/w=; b=SrShC1uJKkUhThP5YCoZt7esj0udLEbyP/zozRfIDAdGJjBukM4zvtNV93ynzO6NCjOQ9SfLsOHghm1Bzu9cQtZyseHiSEn0mC6vrs8ip8R6jwEHHj91uPDVXpXniuST0SHyOa7i6cZUYHGmqhtrdQ11OEgpNqSqaFeRF08wSKQ= Received: from CY1PR07MB2619.namprd07.prod.outlook.com (10.167.16.145) by CY1PR07MB2263.namprd07.prod.outlook.com (10.164.112.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.21; Sat, 3 Nov 2018 01:48:54 +0000 Received: from CY1PR07MB2619.namprd07.prod.outlook.com ([fe80::4148:a47b:92b5:588c]) by CY1PR07MB2619.namprd07.prod.outlook.com ([fe80::4148:a47b:92b5:588c%7]) with mapi id 15.20.1294.024; Sat, 3 Nov 2018 01:48:54 +0000 From: Leonid Bloch To: "qemu-devel@nongnu.org" Thread-Topic: [PATCH] vdi: Use a literal number of bytes for DEFAULT_CLUSTER_SIZE Thread-Index: AQHUcxdg03V4hBhmXUu0Maxy2puqtA== Date: Sat, 3 Nov 2018 01:48:53 +0000 Message-ID: <20181103014831.29889-1-lbloch@janustech.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6PR05CA0015.eurprd05.prod.outlook.com (2603:10a6:20b:2e::28) To CY1PR07MB2619.namprd07.prod.outlook.com (2a01:111:e400:c637::17) authentication-results: spf=none (sender IP is ) smtp.mailfrom=lbloch@janustech.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [141.226.29.227] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CY1PR07MB2263; 6:Sbg2wVYN564oxHqeDFEkH0o+U+uXLvOBMAf3EO8hpjOS7atDF5WymaS94dEMHviTOGUJ2zvrtPHmzPj/NojrcKgu5WNnG1Oqkw4I43iWhZfUQlHZ9SEK2aW/LgTYpXZStngFZdvxPA8DVPJ1n2mVcsAfdRhbidnu9rUsiEVezzvOc5IV3Qn5gZHRGmPA79df7sZ/9HxICC8dWGyceGwdotF36fC4azlcrleH9Q4iwoZYq7gMCSO3nn3FmEoU/Q7kpw9raxZP6b3sHJLMRLe5kWr1BM/b6zBPlqWAK0vHHaBmePOVrCtZ3QFwLbBLa781Oddrz5a9uANj7691Xe1tNxgafQUtAgdKi16WoYAWMWgzmyuVJ+IiP6mX1T/Y9w91HM9yMzUglEdi72pc6JhSmN3aOVIGI92v6CeU23Mh4w5ErDUFnT6RUDDSvJxfCmbG3jieBmMcgAp4UVDRoloWCA==; 5:fp/6dT8qyfmPKlx4+VmDILKqu4Ic9Cn1WWsbaE9InI22eOf7adATz/OAG8zejHGUrFgAUz3fdKLCFB2lktsif0cjrqeKHIpwSqcnocnR9QSOp1ObJpcWu0OZf2tqMot/LILjshvB1R0OeCOFIrt5dqIUfbP4bfD5vse1AeZHNdc=; 7:yss144G+Lz8bvBQFJvuMXalKvZ9C2wH3s+YGKmm2EIphQ+CixqVEiT2NOBeCw3k0d9vgxh8w4ZJXzGWS07UHhzBTpt31XTNgsZy8YxL8MWU4QtgCf5PB0u3Zjw2OQz5TgfKURoooObiQ+otSMkW0UA== x-ms-office365-filtering-correlation-id: ecb8d10b-dbc7-44c3-df03-08d6412e8248 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(7021145)(8989299)(5600074)(711020)(4534185)(7022145)(4603075)(4627221)(201702281549075)(8990200)(7048125)(7024125)(7027125)(7023125)(2017052603328)(7153060)(7193020); SRVR:CY1PR07MB2263; x-ms-traffictypediagnostic: CY1PR07MB2263: 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)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231382)(944501410)(52105095)(148016)(149066)(150057)(6041310)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(2016111802025)(6043046)(201708071742011)(7699051)(76991095); SRVR:CY1PR07MB2263; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2263; x-forefront-prvs: 08457955C4 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(39830400003)(136003)(346002)(376002)(366004)(396003)(189003)(199004)(3846002)(6116002)(2906002)(5660300001)(1076002)(86362001)(486006)(2501003)(4326008)(1857600001)(7736002)(305945005)(68736007)(36756003)(97736004)(54906003)(66066001)(99286004)(316002)(256004)(14454004)(14444005)(8936002)(8676002)(476003)(2616005)(81166006)(81156014)(71190400001)(71200400001)(5640700003)(508600001)(6916009)(386003)(6486002)(6506007)(6512007)(53936002)(6436002)(52116002)(186003)(25786009)(107886003)(2900100001)(105586002)(106356001)(102836004)(26005)(2351001); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR07MB2263; H:CY1PR07MB2619.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: janustech.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: I6/jhsBrNs6yVa3KBI3ukbVbaWS7v3aqVnwe3Qe6PlV1NX4rNf64ys4n2U68Jmr3QhgPIXBFHdtH4+Qc/TsxAdESXFtI7qMuXwEvI1J3W2qGrVkVrL7SuIkLT4oi6KC9S0TPk3u53FV570kY93KeSPQsKgLI+AuRtyMRKLuyqq5iQx/n6lSfQYRv8Iw8Xh0vaNdZDAENbxVIIMz82tjqdPS4IYpTBzFsqHxP5AfFpWzRC5M0+KZCD2s9+lHqbsVjsIbt34gH+tiuku/IZ6t14Tpb7KQDLYiMyAlekx7KlRxbbffSB6jIvHvUMb6bLl6QYVhIqkWFlpmTaYogTirMzjYUVTvNXFPRImAaHiodEDQ= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: janustech.com X-MS-Exchange-CrossTenant-Network-Message-Id: ecb8d10b-dbc7-44c3-df03-08d6412e8248 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Nov 2018 01:48:53.9774 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 34eb020e-3cf3-43a1-afeb-f5cf1310628e X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2263 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.42.92 Subject: [Qemu-devel] [PATCH] vdi: Use a literal number of bytes for DEFAULT_CLUSTER_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 , Stefan Weil , Leonid Bloch , "qemu-block@nongnu.org" , Max Reitz Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP If an expression is used to define DEFAULT_CLUSTER_SIZE, when compiled, it will be embedded as a literal expression in the binary (as the default value) because it is stringified to mark the size of the default value. Now this is fixed by using a defined number to define this value. Signed-off-by: Leonid Bloch --- block/vdi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/vdi.c b/block/vdi.c index 6555cffb88..25320eff47 100644 --- a/block/vdi.c +++ b/block/vdi.c @@ -85,7 +85,7 @@ #define BLOCK_OPT_STATIC "static" #define SECTOR_SIZE 512 -#define DEFAULT_CLUSTER_SIZE (1 * MiB) +#define DEFAULT_CLUSTER_SIZE S_1MiB #if defined(CONFIG_VDI_DEBUG) #define VDI_DEBUG 1