parallels: fix default options parsing
PATCH 1/1 parallels: fix default options parsing
From: Edgar Kaziahmedov <[email protected]>
parallels block driver is completely broken since commit
commit 75cdcd1553e74b5edc58aed23e3b2da8dabb1876
Author: Markus Armbruster <[email protected]>
Date: Tue Feb 21 21:14:08 2017 +0100
option: Fix checking of sizes for overflow and trailing crap
Right now even simple
qemu-io -c "read 512 64k" 1.hds
ends up with
Unexpected error in parse_option_size() at util/qemu-option.c:188:
Parameter 'prealloc-size' expects a non-negative number below 2^64 Aborted (core dumped)
The cure is simple - we should use 'M' as a suffix in default option value instead of 'MiB'.
--- block/parallels.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
block/parallels.c +1 -1
@@ -114,7 +114,7 @@ static QemuOptsList parallels_runtime_opts = { .name = PARALLELS_OPT_PREALLOC_SIZE, .type = QEMU_OPT_SIZE, .help = "Preallocation size on image expansion", - .def_value_str = "128MiB", + .def_value_str = "128M", }, { .name = PARALLELS_OPT_PREALLOC_MODE,
Signature · 1 line
2.7.4
Quoted 29 lines · Denis V. Lunev
From: Edgar Kaziahmedov <[email protected]>
parallels block driver is completely broken since commit
commit75cdcd1553e74b5edc58aed23e3b2da8dabb1876
Author: Markus Armbruster <[email protected]>
Date: Tue Feb 21 21:14:08 2017 +0100
option: Fix checking of sizes for overflow and trailing crap
Right now even simpleqemu-io -c "read 512 64k" 1.hdsends up with
Unexpected error inparse_option_size()atutil/qemu-option.c:188:
Parameter 'prealloc-size' expects a non-negative number below 2^64 Aborted (core dumped)
The cure is simple - we should use 'M' as a suffix in default option value instead of 'MiB'.Signed-off-by Edgar Kaziahmedov <[email protected]>Signed-off-by Denis V. Lunev <[email protected]>CC Markus Armbruster <[email protected]>CC Stefan Hajnoczi <[email protected]>--- block/parallels.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)block/parallels.c +0
-0
block/parallels.c static QemuOptsList parallels_runtime_opts = { · line 120
Quoted 8 lines
block/parallels.c +1
-1@@ -114,7 +114,7 @@ static QemuOptsList parallels_runtime_opts = { .name = PARALLELS_OPT_PREALLOC_SIZE, .type = QEMU_OPT_SIZE, .help = "Preallocation size on image expansion", - .def_value_str = "128MiB", + .def_value_str = "128M", }, { .name = PARALLELS_OPT_PREALLOC_MODE,
Sorry for breaking this. git-grep def_value_str doesn't find more.
Stefan Hajnoczi
AppliedQuoted 16 lines · Denis V. Lunev
From: Edgar Kaziahmedov <[email protected]>
parallels block driver is completely broken since commit
commit75cdcd1553e74b5edc58aed23e3b2da8dabb1876
Author: Markus Armbruster <[email protected]>
Date: Tue Feb 21 21:14:08 2017 +0100
option: Fix checking of sizes for overflow and trailing crap
Right now even simpleqemu-io -c "read 512 64k" 1.hdsends up with
Unexpected error inparse_option_size()atutil/qemu-option.c:188:
Parameter 'prealloc-size' expects a non-negative number below 2^64 Aborted (core dumped)
The cure is simple - we should use 'M' as a suffix in default option value instead of 'MiB'.
Quoted 7 lines
Signed-off-by Edgar Kaziahmedov <[email protected]>Signed-off-by Denis V. Lunev <[email protected]>CC Markus Armbruster <[email protected]>CC Stefan Hajnoczi <[email protected]>--- block/parallels.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks, applied to my block tree:
https://github.com/stefanha/qemu/commits/block
Stefan