diff options
author | Eric Blake <eblake@redhat.com> | 2015-09-10 10:19:16 -0600 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2015-09-18 14:34:39 +0200 |
commit | 50b7b000c9171c1253c1c875f46f654c3c0e1fc8 (patch) | |
tree | 2972106f6aeee4784741c5bcf4673e0f1d67ccaa /include/qapi | |
parent | 615cf669b55a689f9e535ecf87075e50004b6e0a (diff) | |
download | qemu-50b7b000c9171c1253c1c875f46f654c3c0e1fc8.zip qemu-50b7b000c9171c1253c1c875f46f654c3c0e1fc8.tar.gz qemu-50b7b000c9171c1253c1c875f46f654c3c0e1fc8.tar.bz2 |
hmp: Allow for error message hints on HMP
Commits 7216ae3d and d2828429 disabled some error message hints,
all because a change to use modern error reporting meant that the
hint would be output prior to the actual error. Fix this by making
hints a first-class member of Error.
For example, we are now back to the pleasant:
$ qemu-system-x86_64 --nodefaults -S --vnc :0 --chardev null,id=,
qemu-system-x86_64: --chardev null,id=,: Parameter 'id' expects an identifier
Identifiers consist of letters, digits, '-', '.', '_', starting with a letter.
Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <1441901956-21991-1-git-send-email-eblake@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'include/qapi')
-rw-r--r-- | include/qapi/error.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/qapi/error.h b/include/qapi/error.h index 426d5ea..d7878c3 100644 --- a/include/qapi/error.h +++ b/include/qapi/error.h @@ -155,6 +155,13 @@ void error_setg_win32_internal(Error **errp, */ void error_propagate(Error **dst_errp, Error *local_err); +/** + * Append a printf-style human-readable explanation to an existing error. + * May be called multiple times, and safe if @errp is NULL. + */ +void error_append_hint(Error **errp, const char *fmt, ...) + GCC_FMT_ATTR(2, 3); + /* * Convenience function to report open() failure. */ |