[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PATCH v4 02/40] vdi: Use definitions from "qemu/units.h"
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-trivial] [PATCH v4 02/40] vdi: Use definitions from "qemu/units.h" |
Date: |
Sun, 10 Jun 2018 22:14:23 -0300 |
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
block/vdi.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/block/vdi.c b/block/vdi.c
index 668af0a828..35b51dc5c5 100644
--- a/block/vdi.c
+++ b/block/vdi.c
@@ -50,6 +50,7 @@
*/
#include "qemu/osdep.h"
+#include "qemu/units.h"
#include "qapi/error.h"
#include "qapi/qmp/qdict.h"
#include "qapi/qobject-input-visitor.h"
@@ -83,9 +84,6 @@
/* Command line option for static images. */
#define BLOCK_OPT_STATIC "static"
-#define KiB 1024
-#define MiB (KiB * KiB)
-
#define SECTOR_SIZE 512
#define DEFAULT_CLUSTER_SIZE (1 * MiB)
@@ -250,7 +248,7 @@ static void vdi_header_print(VdiHeader *header)
logout("heads 0x%04x\n", header->heads);
logout("sectors 0x%04x\n", header->sectors);
logout("sector size 0x%04x\n", header->sector_size);
- logout("image size 0x%" PRIx64 " B (%" PRIu64 " MiB)\n",
+ logout("image size 0x%" PRIx64 " B (%llu MiB)\n",
header->disk_size, header->disk_size / MiB);
logout("block size 0x%04x\n", header->block_size);
logout("block extra 0x%04x\n", header->block_extra);
@@ -434,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 %u)", header.block_size, DEFAULT_CLUSTER_SIZE);
+ " is not %llu)", header.block_size, DEFAULT_CLUSTER_SIZE);
ret = -ENOTSUP;
goto fail;
} else if (header.disk_size >
--
2.17.1
- [Qemu-trivial] [PATCH v4 00/40] Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-trivial] [PATCH v4 01/40] include: Add IEC binary prefixes in "qemu/units.h", Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-trivial] [PATCH v4 02/40] vdi: Use definitions from "qemu/units.h",
Philippe Mathieu-Daudé <=
- [Qemu-trivial] [PATCH v4 03/40] x86/cpu: Use definitions from "qemu/units.h", Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-trivial] [PATCH v4 04/40] checkpatch: Recognize IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-trivial] [PATCH v4 05/40] hw: Use IEC binary prefix definitions from "qemu/units.h", Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-trivial] [PATCH v4 06/40] hw: Directly use "qemu/units.h" instead of "qemu/cutils.h", Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-trivial] [PATCH v4 07/40] hw/ivshmem: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10