[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-block] [PATCH v4 02/40] vdi: Use definitions from "qemu/units.h"
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-block] [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-block] [PATCH v4 00/40] Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- [Qemu-block] [PATCH v4 02/40] vdi: Use definitions from "qemu/units.h",
Philippe Mathieu-Daudé <=
- [Qemu-block] [PATCH v4 11/40] hw/xen: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
- Re: [Qemu-block] [Qemu-devel] [PATCH v4 11/40] hw/xen: Use the IEC binary prefix definitions, Richard Henderson, 2018/06/12
- Re: [Qemu-block] [Qemu-devel] [PATCH v4 11/40] hw/xen: Use the IEC binary prefix definitions, Eric Blake, 2018/06/12
- Re: [Qemu-block] [Qemu-devel] [PATCH v4 11/40] hw/xen: Use the IEC binary prefix definitions, Richard Henderson, 2018/06/12
- Re: [Qemu-block] [Qemu-devel] [PATCH v4 11/40] hw/xen: Use the IEC binary prefix definitions, Eric Blake, 2018/06/13
- Re: [Qemu-block] [Qemu-devel] [PATCH v4 11/40] hw/xen: Use the IEC binary prefix definitions, Richard Henderson, 2018/06/13
- Re: [Qemu-block] [Qemu-devel] [PATCH v4 11/40] hw/xen: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/13
[Qemu-block] [PATCH v4 13/40] hw/block: Use the IEC binary prefix definitions, Philippe Mathieu-Daudé, 2018/06/10
Re: [Qemu-block] [PATCH v4 00/40] Use the IEC binary prefix definitions, Michael S. Tsirkin, 2018/06/10