From patchwork Sun Nov 4 18:09:28 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonid Bloch X-Patchwork-Id: 10666981 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 589C914BD for ; Sun, 4 Nov 2018 18:11:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4ABBA297D9 for ; Sun, 4 Nov 2018 18:11:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3F24A297F5; Sun, 4 Nov 2018 18:11: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 D4869297D9 for ; Sun, 4 Nov 2018 18:11:57 +0000 (UTC) Received: from localhost ([::1]:59831 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJMsP-0008KX-7C for patchwork-qemu-devel@patchwork.kernel.org; Sun, 04 Nov 2018 13:11:57 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40992) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gJMqL-0007C9-3r for qemu-devel@nongnu.org; Sun, 04 Nov 2018 13:09:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gJMqE-0004gA-3m for qemu-devel@nongnu.org; Sun, 04 Nov 2018 13:09:44 -0500 Received: from mail-eopbgr710118.outbound.protection.outlook.com ([40.107.71.118]:42958 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 ) id 1gJMqA-0004QI-EM; Sun, 04 Nov 2018 13:09:40 -0500 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=NZ5OipRrpqpnvDTD51+p3H6k0oEt7XDxLRV9b/m99x0=; b=oZckKgYgMWaseg6GM4DD6LI9feWSC4Ko5UGKBxLMzUgv2KMqfGGtg1/mk8tlqiVsHN7/nuXSzzVFkuWm9eqdP9eaRdSrCfkkqHCo8itJc4sFxrheFATWNxULCzVIE229N6mkXTOYZ9n6eTIk32b+jmk5aSXRm7WtHT1i6HzfGdM= Received: from CY1PR07MB2619.namprd07.prod.outlook.com (10.167.16.145) by CY1PR07MB2604.namprd07.prod.outlook.com (10.167.16.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1294.28; Sun, 4 Nov 2018 18:09:28 +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.028; Sun, 4 Nov 2018 18:09:28 +0000 From: Leonid Bloch To: "qemu-devel@nongnu.org" Thread-Topic: [PATCH v2 1/1] vdi: Use a literal number of bytes for DEFAULT_CLUSTER_SIZE Thread-Index: AQHUdGmGvefdYumkKEiGpiDh9ufUJw== Date: Sun, 4 Nov 2018 18:09:28 +0000 Message-ID: <20181104180900.7527-2-lbloch@janustech.com> References: <20181104180900.7527-1-lbloch@janustech.com> In-Reply-To: <20181104180900.7527-1-lbloch@janustech.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: AM6PR0502CA0066.eurprd05.prod.outlook.com (2603:10a6:20b:56::43) 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; CY1PR07MB2604; 6:+XsRY89CrByCCl95Q37ASnanhneBnJejRKdwidYsgOHYwtrRI++yGdY4MHUCiQVyUqxcQvNzFu3uD+tu69HD0pzuqdJL8B+UjpvXQVd8sCL5wSkG8x2oZzr4uBFxFlzLWnElvrz84HVEG+K4ZCOAWUUOfz/AsPiJxNaIgD7udpPRGixoZ05vJI86R8pcM6uhbFUuH0fet087SbKdGVBGT20oKmmCj3RUdacoUBj1bdv+DJ+W9yqAx+9DF5XWDwQhYUjG8sxg7I0sQaYa8FJdcVVKIJxz3YAry2fRTeoIhEgk8N8eSalhm6dlZVz5FA2rBjRn5xuAmp8WajLFixy1EuaLwu8urwGQ2fO68XIligXsBUEMAhK442sruALO0L6Wm1KVUXu1yiqUp0CJYadcyzIDZ3nLyBdM/ExFxYJTYl8LjurGRW399kjPwnOTChPkKFGbnUZF7wuNCLrCpYiXmA==; 5:LUuj6OrFJz4NwmQtgVJN/WMJULrOXTiw56wmqEFsan3Sbj/l3S9f69Rqe2LNHX/TC+tKbXHmER1K6SF/lf3NlgMptEjpqW4rdZPWdzWLeIezgUv+bJIMQurbuBcndgqSxPtp6Nvpz+n1uofroKWHM4Dg5Ewl1Zg+c0YkFyMTWmo=; 7:20YauwYMROQKU0leq+ROBKVnx58y9pno9J1Lb24vzEcep0ZEvThUqn/iBmvl/c6iJtGmSQKLgNhsHi7NffCwdPbGrcbWGS8DZRGhP0y1a/rw0Z1z5EvyBhoryHWSxMWLbE43db/WeytloPT74nFJew== x-ms-office365-filtering-correlation-id: 527f487a-fc82-4760-c6b7-08d64280a923 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(7021145)(8989299)(4534185)(7022145)(4603075)(4627221)(201702281549075)(8990200)(7048125)(7024125)(7027125)(7023125)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:CY1PR07MB2604; x-ms-traffictypediagnostic: CY1PR07MB2604: 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)(10201501046)(3002001)(93006095)(93001095)(3231382)(944501410)(52105095)(148016)(149066)(150057)(6041310)(2016111802025)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(6043046)(201708071742011)(7699051)(76991095); SRVR:CY1PR07MB2604; BCL:0; PCL:0; RULEID:; SRVR:CY1PR07MB2604; x-forefront-prvs: 084674B2CF x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(346002)(376002)(396003)(39830400003)(136003)(189003)(199004)(71190400001)(71200400001)(7736002)(305945005)(97736004)(53936002)(8676002)(14454004)(2351001)(99286004)(36756003)(86362001)(446003)(11346002)(81156014)(6916009)(81166006)(76176011)(106356001)(486006)(2616005)(476003)(52116002)(66066001)(8936002)(508600001)(4326008)(25786009)(6486002)(186003)(5660300001)(386003)(6506007)(107886003)(68736007)(6512007)(105586002)(2906002)(6436002)(1076002)(2501003)(316002)(256004)(102836004)(54906003)(2900100001)(6116002)(26005)(5640700003)(3846002); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR07MB2604; 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: SEVefy5FiVVPlABffiobUe6Q7lc6pvuBg3W6ezWT3dow9vXBDqR0oANJ+srj9pumf0mcRpjiL0Ipc2lmCrUTRMkhhuMZ3k3Ia/s5U47UsTR2i+9w3eTKvDa7wyLI9D0VJyD5Rl+BXgjsAd1543tlTCE78hqk2J2pvvMj5sMk9Gbyb3AM69/S5q0fBk8GpECbCmoE0ApytiDIO9MQWdHQ+boqQz2BiT6U3igHQe9jMxYeAsHYFyPfoB4k7IvKRuhI9u6HRMksKZcddRi29SOz7zyKZjTq6Taz9dYKfGCA2XZ1mFEiH9zHWYXkzMbH+fVI6flbQSMPEkwCIM2pvsSoOTxiYvm5Mnbf7LLxtnTlAYA= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: janustech.com X-MS-Exchange-CrossTenant-Network-Message-Id: 527f487a-fc82-4760-c6b7-08d64280a923 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Nov 2018 18:09:28.4507 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 34eb020e-3cf3-43a1-afeb-f5cf1310628e X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2604 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.71.118 Subject: [Qemu-devel] [PATCH v2 1/1] 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 Reviewed-by: Stefan Weil --- block/vdi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/block/vdi.c b/block/vdi.c index 6555cffb88..d996793f1c 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 @@ -432,7 +432,7 @@ static int vdi_open(BlockDriverState *bs, QDict *options, int flags, goto fail; } else if (header.block_size != DEFAULT_CLUSTER_SIZE) { error_setg(errp, "unsupported VDI image (block size %" PRIu32 - " is not %" PRIu64 ")", + " is not %" PRIu32 ")", header.block_size, DEFAULT_CLUSTER_SIZE); ret = -ENOTSUP; goto fail;