From 43c5d8f8001eb467abf091c3e2a8aca3d1e5b522 Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Tue, 9 Dec 2014 15:38:04 +0800 Subject: block: Don't add trailing space in "Formating..." message Change the message printing code to output a separator for each option string before it instead of after, then we don't one more extra ' ' in the end. To update qemu-iotests output files, most of the times one would just copy the *.out.bad to *.out. With this change we will not have the space disliked by checkpatch.pl. Signed-off-by: Fam Zheng Reviewed-by: Eric Blake Reviewed-by: Markus Armbruster Message-id: 1418110684-19528-3-git-send-email-famz@redhat.com Signed-off-by: Stefan Hajnoczi --- util/qemu-option.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'util') diff --git a/util/qemu-option.c b/util/qemu-option.c index 5d10695..a708241 100644 --- a/util/qemu-option.c +++ b/util/qemu-option.c @@ -737,14 +737,14 @@ void qemu_opts_del(QemuOpts *opts) g_free(opts); } -void qemu_opts_print(QemuOpts *opts) +void qemu_opts_print(QemuOpts *opts, const char *sep) { QemuOpt *opt; QemuOptDesc *desc = opts->list->desc; if (desc[0].name == NULL) { QTAILQ_FOREACH(opt, &opts->head, next) { - printf("%s=\"%s\" ", opt->name, opt->str); + printf("%s%s=\"%s\"", sep, opt->name, opt->str); } return; } @@ -757,12 +757,12 @@ void qemu_opts_print(QemuOpts *opts) continue; } if (desc->type == QEMU_OPT_STRING) { - printf("%s='%s' ", desc->name, value); + printf("%s%s='%s'", sep, desc->name, value); } else if ((desc->type == QEMU_OPT_SIZE || desc->type == QEMU_OPT_NUMBER) && opt) { - printf("%s=%" PRId64 " ", desc->name, opt->value.uint); + printf("%s%s=%" PRId64, sep, desc->name, opt->value.uint); } else { - printf("%s=%s ", desc->name, value); + printf("%s%s=%s", sep, desc->name, value); } } } -- cgit v1.1