[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 4/6] qemu: Prefer '(x * MiB)' over 'S_xiB'
From: |
Eric Blake |
Subject: |
[Qemu-devel] [PATCH v3 4/6] qemu: Prefer '(x * MiB)' over 'S_xiB' |
Date: |
Thu, 10 Jan 2019 13:18:58 -0600 |
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 <address@hidden>
---
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"
--
2.20.1
- [Qemu-devel] [PATCH v3 0/6] include: Auto-generate the sizes lookup table, Eric Blake, 2019/01/10
- [Qemu-devel] [PATCH v3 3/6] Revert "vdi: Use a literal number of bytes for DEFAULT_CLUSTER_SIZE", Eric Blake, 2019/01/10
- [Qemu-devel] [PATCH v3 2/6] block: Take advantage of QemuOpt default integers, Eric Blake, 2019/01/10
- [Qemu-devel] [PATCH v3 4/6] qemu: Prefer '(x * MiB)' over 'S_xiB',
Eric Blake <=
- [Qemu-devel] [PATCH v3 5/6] Revert "include: Add a comment to explain the origin of sizes' lookup table", Eric Blake, 2019/01/10
- [Qemu-devel] [PATCH v3 6/6] Revert "include: Add a lookup table of sizes", Eric Blake, 2019/01/10
- Re: [Qemu-devel] [Qemu-block] [PATCH v3 0/6] include: Auto-generate the sizes lookup table, Eric Blake, 2019/01/10
- Re: [Qemu-devel] [PATCH v3 0/6] include: Auto-generate the sizes lookup table, Kevin Wolf, 2019/01/11
- Re: [Qemu-devel] [PATCH v3 0/6] include: Auto-generate the sizes lookup table, no-reply, 2019/01/14