To produce same output while using "qemu-img create", opt->str
should store pure digit, without suffixes.

Signed-off-by: Dong Xu Wang <wdon...@linux.vnet.ibm.com>
---
 util/qemu-option.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/util/qemu-option.c b/util/qemu-option.c
index b939e8a..861929d 100644
--- a/util/qemu-option.c
+++ b/util/qemu-option.c
@@ -675,6 +675,8 @@ static void qemu_opt_parse(QemuOpt *opt, Error **errp)
         break;
     case QEMU_OPT_SIZE:
         parse_option_size(opt->name, opt->str, &opt->value.uint, errp);
+        g_free((char *)opt->str);
+        opt->str = g_strdup(stringify(opt->value_uint));
         break;
     default:
         abort();
-- 
1.7.11.7


Reply via email to