diff options
author | Peter Wu <peter@lekensteyn.nl> | 2014-12-25 22:34:23 +0100 |
---|---|---|
committer | Peter Wu <peter@lekensteyn.nl> | 2014-12-25 22:34:23 +0100 |
commit | 7bb37b813ef9f06e7aa6d7b3c0e4ba2b9ec3f1c1 (patch) | |
tree | aaa8fedf9b038fd23e7e593f581ed5d333fa7e67 | |
parent | 984a6899dcffc94ea0e28f1116a233bd3d6cd51f (diff) | |
download | qemu-7bb37b813ef9f06e7aa6d7b3c0e4ba2b9ec3f1c1.tar.gz |
Revert "block/dmg: increase maximum image size to 64 GiB"
It turns out that the large memory usage was requested by an all-zeroes
block which should be treated specially.
This reverts commit 84c8c3f22753c7d01bace23841bbe63b9179b3cd.
-rw-r--r-- | block/dmg.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/block/dmg.c b/block/dmg.c index f94b6d96ed..87f4b9e0da 100644 --- a/block/dmg.c +++ b/block/dmg.c @@ -35,7 +35,7 @@ enum { /* Limit chunk sizes to prevent unreasonable amounts of memory being used * or truncating when converting to 32-bit types */ - DMG_LENGTHS_MAX = (uint64_t) 64 * 1024 * 1024 * 1024, /* 64 GiB */ + DMG_LENGTHS_MAX = 64 * 1024 * 1024, /* 64 MB */ DMG_SECTORCOUNTS_MAX = DMG_LENGTHS_MAX / 512, }; @@ -246,7 +246,7 @@ static int dmg_read_mish_block(BDRVDMGState *s, DmgHeaderState *ds, if (s->lengths[i] > DMG_LENGTHS_MAX) { error_report("length %" PRIu64 " for chunk %" PRIu32 - " is larger than max (%" PRIu64 ")", + " is larger than max (%u)", s->lengths[i], i, DMG_LENGTHS_MAX); ret = -EINVAL; goto fail; |