Patchwork [v3,3/6] Revert "vdi: Use a literal number of bytes for DEFAULT_CLUSTER_SIZE"

login
register
mail settings
Submitter Eric Blake
Date Jan. 10, 2019, 7:18 p.m.
Message ID <20190110191901.5082-4-eblake@redhat.com>
Download mbox | patch
Permalink /patch/697225/
State New
Headers show

Comments

Eric Blake - Jan. 10, 2019, 7:18 p.m.
This reverts commit 3dd5b8f4718c6ca1eadb16dd67a8cad76455ddb0.

Now that we can express QemuOpts values as an integer, we don't have
to be careful about how we spell our macro.
---
 block/vdi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Eric Blake - Jan. 10, 2019, 7:42 p.m.
On 1/10/19 1:18 PM, Eric Blake wrote:
> This reverts commit 3dd5b8f4718c6ca1eadb16dd67a8cad76455ddb0.
> 
> Now that we can express QemuOpts values as an integer, we don't have
> to be careful about how we spell our macro.

Signed-off-by: Eric Blake <eblake@redhat.com>

> ---
>  block/vdi.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/block/vdi.c b/block/vdi.c
> index 65659c9b179..180a45b70f6 100644
> --- a/block/vdi.c
> +++ b/block/vdi.c
> @@ -85,7 +85,7 @@
>  #define BLOCK_OPT_STATIC "static"
> 
>  #define SECTOR_SIZE 512
> -#define DEFAULT_CLUSTER_SIZE S_1MiB
> +#define DEFAULT_CLUSTER_SIZE (1 * MiB)
> 
>  #if defined(CONFIG_VDI_DEBUG)
>  #define VDI_DEBUG 1
> @@ -432,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 %" PRIu32 ")",
> +                         " is not %" PRIu64 ")",
>                     header.block_size, DEFAULT_CLUSTER_SIZE);
>          ret = -ENOTSUP;
>          goto fail;
>

Patch

diff --git a/block/vdi.c b/block/vdi.c
index 65659c9b179..180a45b70f6 100644
--- a/block/vdi.c
+++ b/block/vdi.c
@@ -85,7 +85,7 @@ 
 #define BLOCK_OPT_STATIC "static"

 #define SECTOR_SIZE 512
-#define DEFAULT_CLUSTER_SIZE S_1MiB
+#define DEFAULT_CLUSTER_SIZE (1 * MiB)

 #if defined(CONFIG_VDI_DEBUG)
 #define VDI_DEBUG 1
@@ -432,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 %" PRIu32 ")",
+                         " is not %" PRIu64 ")",
                    header.block_size, DEFAULT_CLUSTER_SIZE);
         ret = -ENOTSUP;
         goto fail;