From nobody Mon Feb 9 10:48:21 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1547148458157926.7203840853157; Thu, 10 Jan 2019 11:27:38 -0800 (PST) Received: from localhost ([127.0.0.1]:33684 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghfzI-000298-MC for importer@patchew.org; Thu, 10 Jan 2019 14:27:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56578) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ghfra-0005Yo-3D for qemu-devel@nongnu.org; Thu, 10 Jan 2019 14:19:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ghfrX-0000JL-OZ for qemu-devel@nongnu.org; Thu, 10 Jan 2019 14:19:33 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36794) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ghfrI-00005j-4D; Thu, 10 Jan 2019 14:19:16 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6C18EC07457B; Thu, 10 Jan 2019 19:19:15 +0000 (UTC) Received: from blue.redhat.com (ovpn-116-216.phx2.redhat.com [10.3.116.216]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3A32660C67; Thu, 10 Jan 2019 19:19:12 +0000 (UTC) From: Eric Blake To: qemu-devel@nongnu.org Date: Thu, 10 Jan 2019 13:18:58 -0600 Message-Id: <20190110191901.5082-5-eblake@redhat.com> In-Reply-To: <20190110191901.5082-1-eblake@redhat.com> References: <20190110191901.5082-1-eblake@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.32]); Thu, 10 Jan 2019 19:19:15 +0000 (UTC) Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 4/6] qemu: Prefer '(x * MiB)' over 'S_xiB' 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: kwolf@redhat.com, lbloch@janustech.com, armbru@redhat.com, qemu-block@nongnu.org, Max Reitz Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" Now that QemuOpts can accept true integer defaults, we no longer have to be careful about the spelling of our default macros because we are no longer applying stringify() to any of the macros. Although it is slightly more verbose to call out an integer times a scale, it avoids the need to have a list of S_*iB macros that were used in commit b6a95c6d. Signed-off-by: Eric Blake --- block/qcow2.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/block/qcow2.h b/block/qcow2.h index a98d24500b2..d8db6622774 100644 --- a/block/qcow2.h +++ b/block/qcow2.h @@ -50,11 +50,11 @@ /* 8 MB refcount table is enough for 2 PB images at 64k cluster size * (128 GB for 512 byte clusters, 2 EB for 2 MB clusters) */ -#define QCOW_MAX_REFTABLE_SIZE S_8MiB +#define QCOW_MAX_REFTABLE_SIZE (8 * MiB) /* 32 MB L1 table is enough for 2 PB images at 64k cluster size * (128 GB for 512 byte clusters, 2 EB for 2 MB clusters) */ -#define QCOW_MAX_L1_SIZE S_32MiB +#define QCOW_MAX_L1_SIZE (32 * MiB) /* Allow for an average of 1k per snapshot table entry, should be plenty of * space for snapshot names and IDs */ @@ -81,15 +81,15 @@ #define MIN_REFCOUNT_CACHE_SIZE 4 /* clusters */ #ifdef CONFIG_LINUX -#define DEFAULT_L2_CACHE_MAX_SIZE S_32MiB +#define DEFAULT_L2_CACHE_MAX_SIZE (32 * MiB) #define DEFAULT_CACHE_CLEAN_INTERVAL 600 /* seconds */ #else -#define DEFAULT_L2_CACHE_MAX_SIZE S_8MiB +#define DEFAULT_L2_CACHE_MAX_SIZE (8 * MiB) /* Cache clean interval is currently available only on Linux, so must be 0= */ #define DEFAULT_CACHE_CLEAN_INTERVAL 0 #endif -#define DEFAULT_CLUSTER_SIZE S_64KiB +#define DEFAULT_CLUSTER_SIZE (64 * KiB) #define QCOW2_OPT_LAZY_REFCOUNTS "lazy-refcounts" #define QCOW2_OPT_DISCARD_REQUEST "pass-discard-request" --=20 2.20.1