[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 3/5] block: Change BlockDriverInfo.cluster_size to 6
From: |
Fam Zheng |
Subject: |
[Qemu-devel] [PATCH 3/5] block: Change BlockDriverInfo.cluster_size to 64 bits |
Date: |
Wed, 13 Nov 2013 08:53:12 +0800 |
VMDK could have big cluster_size for monolithicFlat. It implements
.bdrv_get_info now, a 32 bit field is likely to overflow.
Signed-off-by: Fam Zheng <address@hidden>
---
include/block/block.h | 2 +-
qemu-img.c | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/include/block/block.h b/include/block/block.h
index 169c092..7059bb4 100644
--- a/include/block/block.h
+++ b/include/block/block.h
@@ -14,7 +14,7 @@ typedef struct BlockJob BlockJob;
typedef struct BlockDriverInfo {
/* in bytes, 0 if irrelevant */
- int cluster_size;
+ int64_t cluster_size;
/* offset at which the VM state can be saved (0 if not possible) */
int64_t vm_state_offset;
bool is_dirty;
diff --git a/qemu-img.c b/qemu-img.c
index 09ed9b2..6ca19ff 100644
--- a/qemu-img.c
+++ b/qemu-img.c
@@ -1121,8 +1121,9 @@ out3:
static int img_convert(int argc, char **argv)
{
- int c, ret = 0, n, n1, bs_n, bs_i, compress, cluster_size,
+ int c, ret = 0, n, n1, bs_n, bs_i, compress,
cluster_sectors, skip_create;
+ int64_t cluster_size;
int progress = 0, flags;
const char *fmt, *out_fmt, *cache, *out_baseimg, *out_filename;
BlockDriver *drv, *proto_drv;
--
1.8.4.2