Currently this function is not used anywhere. In later patches, it will
replace print_option_parameters. To avoid print info changes, change
qemu_opts_print from fprintf stderr to printf to keep consistent with
print_option_parameters, remove last printf and print size/number with
opt->value.uint instead of opt->str.

Signed-off-by: Chunyan Liu <cy...@suse.com>
---
 util/qemu-option.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/util/qemu-option.c b/util/qemu-option.c
index 5346c90..2be6995 100644
--- a/util/qemu-option.c
+++ b/util/qemu-option.c
@@ -925,7 +925,7 @@ void qemu_opts_print(QemuOpts *opts)
 
     if (desc[0].name == NULL) {
         QTAILQ_FOREACH(opt, &opts->head, next) {
-            fprintf(stderr, "%s=\"%s\" ", opt->name, opt->str);
+            printf("%s=\"%s\" ", opt->name, opt->str);
         }
         return;
     }
@@ -938,12 +938,14 @@ void qemu_opts_print(QemuOpts *opts)
             continue;
         }
         if (desc->type == QEMU_OPT_STRING) {
-            fprintf(stderr, "%s='%s' ", desc->name, value);
+            printf("%s='%s' ", desc->name, value);
+        } else if ((desc->type == QEMU_OPT_SIZE ||
+                    desc->type == QEMU_OPT_NUMBER) && opt) {
+            printf("%s=%" PRId64 " ", desc->name, opt->value.uint);
         } else {
-            fprintf(stderr, "%s=%s ", desc->name, value);
+            printf("%s=%s ", desc->name, value);
         }
     }
-    fprintf(stderr, "\n");
 }
 
 static int opts_do_parse(QemuOpts *opts, const char *params,
-- 
1.8.4.5


Reply via email to