qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [Qemu-devel] [PATCH v4 02/40] vdi: Use definitions fr


From: Stefan Weil
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH v4 02/40] vdi: Use definitions from "qemu/units.h"
Date: Mon, 11 Jun 2018 21:27:03 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0

Am 11.06.2018 um 03:14 schrieb Philippe Mathieu-Daudé:
> 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 >
> 

Reviewed-by: Stefan Weil <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]