diff options
author | Markus Armbruster <armbru@redhat.com> | 2015-12-17 17:35:14 +0100 |
---|---|---|
committer | Timothy Pearson <tpearson@raptorengineering.com> | 2019-11-29 19:28:24 -0600 |
commit | 216d90522decdffee1ee42e339f914fb10307719 (patch) | |
tree | ceefae56cb730c15a074e3b8de934e951546522e /util | |
parent | 61710b3381fd4c8230aead5954487560a24f1cd9 (diff) | |
download | hqemu-216d90522decdffee1ee42e339f914fb10307719.zip hqemu-216d90522decdffee1ee42e339f914fb10307719.tar.gz |
error: Don't append a newline when printing the error hint
Since commit 50b7b00, we have error_append_hint() to conveniently
accumulate Error member @hint. error_report_err() prints it with a
newline appended. Consequently, users of error_append_hint() need to
know whether theirs is the final line of the hint to decide whether it
needs a newline. Not a nice interface.
Change error_report_err() to print just the hint, and the (still few)
users of error_append_hint() to add the required newline.
Cc: Eric Blake <eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Message-Id: <1450370121-5768-7-git-send-email-armbru@redhat.com>
Diffstat (limited to 'util')
-rw-r--r-- | util/error.c | 2 | ||||
-rw-r--r-- | util/qemu-option.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/util/error.c b/util/error.c index 80c89a2..9b27c45 100644 --- a/util/error.c +++ b/util/error.c @@ -204,7 +204,7 @@ void error_report_err(Error *err) { error_report("%s", error_get_pretty(err)); if (err->hint) { - error_printf_unless_qmp("%s\n", err->hint->str); + error_printf_unless_qmp("%s", err->hint->str); } error_free(err); } diff --git a/util/qemu-option.c b/util/qemu-option.c index a50ecea..a2d593a 100644 --- a/util/qemu-option.c +++ b/util/qemu-option.c @@ -206,7 +206,7 @@ void parse_option_size(const char *name, const char *value, default: error_setg(errp, QERR_INVALID_PARAMETER_VALUE, name, "a size"); error_append_hint(errp, "You may use k, M, G or T suffixes for " - "kilobytes, megabytes, gigabytes and terabytes."); + "kilobytes, megabytes, gigabytes and terabytes.\n"); return; } } else { @@ -647,7 +647,7 @@ QemuOpts *qemu_opts_create(QemuOptsList *list, const char *id, error_setg(errp, QERR_INVALID_PARAMETER_VALUE, "id", "an identifier"); error_append_hint(errp, "Identifiers consist of letters, digits, " - "'-', '.', '_', starting with a letter."); + "'-', '.', '_', starting with a letter.\n"); return NULL; } opts = qemu_opts_find(list, id); |