qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 1/2] vdi: Fix error message and two more small code


From: Stefan Weil
Subject: [Qemu-devel] [PATCH 1/2] vdi: Fix error message and two more small code improvements
Date: Wed, 26 Mar 2014 22:38:04 +0100

* Fix wrong error message (copy+paste bug from commit
  5b7aa9b56d1bfc79916262f380c3fc7961becb50).

* Replace the default cluster size of 1 * MiB by DEFAULT_CLUSTER_SIZE.

* Don't check for the default cluster size if we support other sizes, too.

Cc: Kevin Wolf <address@hidden>
Cc: Stefan Hajnoczi <address@hidden>
Signed-off-by: Stefan Weil <address@hidden>
---
 block/vdi.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/block/vdi.c b/block/vdi.c
index ac9a025..b832905 100644
--- a/block/vdi.c
+++ b/block/vdi.c
@@ -420,11 +420,13 @@ static int vdi_open(BlockDriverState *bs, QDict *options, 
int flags,
                    header.sector_size, SECTOR_SIZE);
         ret = -ENOTSUP;
         goto fail;
-    } else if (header.block_size != 1 * MiB) {
-        error_setg(errp, "unsupported VDI image (sector size %u is not %u)",
-                   header.block_size, 1 * MiB);
+#if !defined(CONFIG_VDI_BLOCK_SIZE)
+    } else if (header.block_size != DEFAULT_CLUSTER_SIZE) {
+        error_setg(errp, "unsupported VDI image (block size %u is not %u)",
+                   header.block_size, DEFAULT_CLUSTER_SIZE);
         ret = -ENOTSUP;
         goto fail;
+#endif
     } else if (header.disk_size >
                (uint64_t)header.blocks_in_image * header.block_size) {
         error_setg(errp, "unsupported VDI image (disk size %" PRIu64 ", "
-- 
1.7.10.4




reply via email to

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