diff options
author | Wen Congyang <wency@cn.fujitsu.com> | 2015-03-11 11:05:21 +0800 |
---|---|---|
committer | Stefan Hajnoczi <stefanha@redhat.com> | 2015-03-12 17:41:23 +0000 |
commit | 87b86e7ef29771a7fa06e3e8e88fa95bbc13a39c (patch) | |
tree | b8885cb668b93775edddf18682e8f89d33d3bf72 /block/qcow2.c | |
parent | 2120465fbb87a69bd60283ec4034a0963766a7ef (diff) |
qcow2: fix the macro QCOW_MAX_L1_SIZE's use
QCOW_MAX_L1_SIZE's unit is byte, and l1_size's unit
is l1 table entry size(8 bytes).
Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Message-id: 54FFB0F1.5010307@cn.fujitsu.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Diffstat (limited to 'block/qcow2.c')
-rw-r--r-- | block/qcow2.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/block/qcow2.c b/block/qcow2.c index 8bfb094e53..32bdf756ca 100644 --- a/block/qcow2.c +++ b/block/qcow2.c @@ -742,7 +742,7 @@ static int qcow2_open(BlockDriverState *bs, QDict *options, int flags, } /* read the level 1 table */ - if (header.l1_size > QCOW_MAX_L1_SIZE) { + if (header.l1_size > QCOW_MAX_L1_SIZE / sizeof(uint64_t)) { error_setg(errp, "Active L1 table too large"); ret = -EFBIG; goto fail; |