[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 13/19] block: Don't add trailing space in "Formating.
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL 13/19] block: Don't add trailing space in "Formating..." message |
Date: |
Fri, 12 Dec 2014 17:09:59 +0000 |
From: Fam Zheng <address@hidden>
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 <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Markus Armbruster <address@hidden>
Message-id: address@hidden
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
block.c | 4 ++--
include/qemu/option.h | 2 +-
util/qemu-option.c | 10 +++++-----
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/block.c b/block.c
index a75a992..4165d42 100644
--- a/block.c
+++ b/block.c
@@ -5668,8 +5668,8 @@ void bdrv_img_create(const char *filename, const char
*fmt,
}
if (!quiet) {
- printf("Formatting '%s', fmt=%s ", filename, fmt);
- qemu_opts_print(opts);
+ printf("Formatting '%s', fmt=%s", filename, fmt);
+ qemu_opts_print(opts, " ");
puts("");
}
diff --git a/include/qemu/option.h b/include/qemu/option.h
index 59bea75..58c0157 100644
--- a/include/qemu/option.h
+++ b/include/qemu/option.h
@@ -124,7 +124,7 @@ QDict *qemu_opts_to_qdict(QemuOpts *opts, QDict *qdict);
void qemu_opts_absorb_qdict(QemuOpts *opts, QDict *qdict, Error **errp);
typedef int (*qemu_opts_loopfunc)(QemuOpts *opts, void *opaque);
-void qemu_opts_print(QemuOpts *opts);
+void qemu_opts_print(QemuOpts *opts, const char *sep);
int qemu_opts_foreach(QemuOptsList *list, qemu_opts_loopfunc func, void
*opaque,
int abort_on_failure);
void qemu_opts_print_help(QemuOptsList *list);
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);
}
}
}
--
2.1.0
- [Qemu-devel] [PULL 02/19] vmdk: Fix error for JSON descriptor file names, (continued)
- [Qemu-devel] [PULL 02/19] vmdk: Fix error for JSON descriptor file names, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 03/19] iotests: Add test for vmdk JSON file names, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 04/19] block/rbd: fix memory leak, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 05/19] block: vhdx - remove redundant comments, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 06/19] block: vhdx - update PAYLOAD_BLOCK_UNMAPPED value to match 1.00 spec, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 07/19] block: vhdx - change .vhdx_create default block state to ZERO, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 08/19] qemu-io: Add sigraise command, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 09/19] iotests: Filter for "Killed" in qemu-io output, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 10/19] iotests: Fix test 039, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 11/19] block: vhdx - set .bdrv_has_zero_init to bdrv_has_zero_init_1, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 13/19] block: Don't add trailing space in "Formating..." message,
Stefan Hajnoczi <=
- [Qemu-devel] [PULL 14/19] block: drop unused bdrv_clear_incoming_migration_all() prototype, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 15/19] linux-aio: queue requests that cannot be submitted, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 16/19] linux-aio: track whether the queue is blocked, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 17/19] linux-aio: rename LaioQueue idx field to "n", Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 18/19] linux-aio: drop return code from laio_io_unplug and ioq_submit, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 19/19] linux-aio: simplify removal of completed iocbs from the list, Stefan Hajnoczi, 2014/12/12
- [Qemu-devel] [PULL 12/19] qemu-iotests: Remove traling whitespaces in *.out, Stefan Hajnoczi, 2014/12/12
- Re: [Qemu-devel] [PULL 00/19] Block patches, Peter Maydell, 2014/12/15
- [Qemu-devel] [PULL 00/19] Block patches, Kevin Wolf, 2014/12/19