From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42424) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fSBQh-0004VT-LP for qemu-devel@nongnu.org; Sun, 10 Jun 2018 21:15:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fSBQg-0002Kf-Or for qemu-devel@nongnu.org; Sun, 10 Jun 2018 21:15:31 -0400 Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Date: Sun, 10 Jun 2018 22:14:23 -0300 Message-Id: <20180611011501.10235-3-f4bug@amsat.org> In-Reply-To: <20180611011501.10235-1-f4bug@amsat.org> References: <20180611011501.10235-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH v4 02/40] vdi: Use definitions from "qemu/units.h" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Thomas Huth , Stefan Weil Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org, qemu-trivial@nongnu.org, Kevin Wolf , Max Reitz , "open list:VDI" Signed-off-by: Philippe Mathieu-Daudé --- 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