summaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorPeter Maydell2018-10-23 18:20:23 +0200
committerPeter Maydell2018-10-23 18:20:23 +0200
commit13399aad4fa87b2878c49d02a5d3bafa6c966ba3 (patch)
tree24a1320fa920963aebfea50c345cd682ea34089b /util
parentMerge remote-tracking branch 'remotes/thibault/tags/samuel-thibault' into sta... (diff)
parenterror: Drop bogus "use error_setg() instead" admonitions (diff)
downloadqemu-13399aad4fa87b2878c49d02a5d3bafa6c966ba3.tar.gz
qemu-13399aad4fa87b2878c49d02a5d3bafa6c966ba3.tar.xz
qemu-13399aad4fa87b2878c49d02a5d3bafa6c966ba3.zip
Merge remote-tracking branch 'remotes/armbru/tags/pull-error-2018-10-22' into staging
Error reporting patches for 2018-10-22 # gpg: Signature made Mon 22 Oct 2018 13:20:23 BST # gpg: using RSA key 3870B400EB918653 # gpg: Good signature from "Markus Armbruster <armbru@redhat.com>" # gpg: aka "Markus Armbruster <armbru@pond.sub.org>" # Primary key fingerprint: 354B C8B3 D7EB 2A6B 6867 4E5F 3870 B400 EB91 8653 * remotes/armbru/tags/pull-error-2018-10-22: (40 commits) error: Drop bogus "use error_setg() instead" admonitions vpc: Fail open on bad header checksum block: Clean up bdrv_img_create()'s error reporting vl: Simplify call of parse_name() vl: Fix exit status for -drive format=help blockdev: Convert drive_new() to Error vl: Assert drive_new() does not fail in default_drive() fsdev: Clean up error reporting in qemu_fsdev_add() spice: Clean up error reporting in add_channel() tpm: Clean up error reporting in tpm_init_tpmdev() numa: Clean up error reporting in parse_numa() vnc: Clean up error reporting in vnc_init_func() ui: Convert vnc_display_init(), init_keyboard_layout() to Error ui/keymaps: Fix handling of erroneous include files vl: Clean up error reporting in device_init_func() vl: Clean up error reporting in parse_fw_cfg() vl: Clean up error reporting in mon_init_func() vl: Clean up error reporting in machine_set_property() vl: Clean up error reporting in chardev_init_func() qom: Clean up error reporting in user_creatable_add_opts_foreach() ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'util')
-rw-r--r--util/error.c13
-rw-r--r--util/qemu-error.c5
2 files changed, 13 insertions, 5 deletions
diff --git a/util/error.c b/util/error.c
index 3efdd69162..b5ccbd8eac 100644
--- a/util/error.c
+++ b/util/error.c
@@ -292,3 +292,16 @@ void error_propagate(Error **dst_errp, Error *local_err)
error_free(local_err);
}
}
+
+void error_propagate_prepend(Error **dst_errp, Error *err,
+ const char *fmt, ...)
+{
+ va_list ap;
+
+ if (dst_errp && !*dst_errp) {
+ va_start(ap, fmt);
+ error_vprepend(&err, fmt, ap);
+ va_end(ap);
+ } /* else error is being ignored, don't bother with prepending */
+ error_propagate(dst_errp, err);
+}
diff --git a/util/qemu-error.c b/util/qemu-error.c
index 4ab428f7e4..fcbe8a1f74 100644
--- a/util/qemu-error.c
+++ b/util/qemu-error.c
@@ -194,7 +194,6 @@ bool enable_timestamp_msg;
* Format arguments like vsprintf(). The resulting message should be
* a single phrase, with no newline or trailing punctuation.
* Prepend the current location and append a newline.
- * It's wrong to call this in a QMP monitor. Use error_setg() there.
*/
static void vreport(report_type type, const char *fmt, va_list ap)
{
@@ -242,7 +241,6 @@ void error_vreport(const char *fmt, va_list ap)
* Format arguments like vsprintf(). The resulting message should be
* a single phrase, with no newline or trailing punctuation.
* Prepend the current location and append a newline.
- * It's wrong to call this in a QMP monitor. Use error_setg() there.
*/
void warn_vreport(const char *fmt, va_list ap)
{
@@ -255,7 +253,6 @@ void warn_vreport(const char *fmt, va_list ap)
* Format arguments like vsprintf(). The resulting message should be
* a single phrase, with no newline or trailing punctuation.
* Prepend the current location and append a newline.
- * It's wrong to call this in a QMP monitor. Use error_setg() there.
*/
void info_vreport(const char *fmt, va_list ap)
{
@@ -283,7 +280,6 @@ void error_report(const char *fmt, ...)
* Format arguments like sprintf(). The resulting message should be a
* single phrase, with no newline or trailing punctuation.
* Prepend the current location and append a newline.
- * It's wrong to call this in a QMP monitor. Use error_setg() there.
*/
void warn_report(const char *fmt, ...)
{
@@ -300,7 +296,6 @@ void warn_report(const char *fmt, ...)
* Format arguments like sprintf(). The resulting message should be a
* single phrase, with no newline or trailing punctuation.
* Prepend the current location and append a newline.
- * It's wrong to call this in a QMP monitor. Use error_setg() there.
*/
void info_report(const char *fmt, ...)
{