HMP: Prepend errors with 'Error:'
authorDr. David Alan Gilbert <dgilbert@redhat.com>
Tue, 12 Feb 2019 13:47:56 +0000 (13:47 +0000)
committerLaurent Vivier <laurent@vivier.eu>
Thu, 14 Feb 2019 10:46:30 +0000 (11:46 +0100)
Always make error messages start with 'Error:' as a fallback
to make sure that anything parsing them can tell it failed.

Note: Some places don't use hmp_handle_error

Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Message-Id: <20190212134758.10514-3-dgilbert@redhat.com>
Signed-off-by: Laurent Vivier <laurent@vivier.eu>
hmp.c

diff --git a/hmp.c b/hmp.c
index b2a2b1f84e33611533a8e99a8422bc9571cc592d..4d14718fea4a5a21a8eaa6c5df51b6f5bdf1a8c6 100644 (file)
--- a/hmp.c
+++ b/hmp.c
@@ -62,7 +62,7 @@ static void hmp_handle_error(Monitor *mon, Error **errp)
 {
     assert(errp);
     if (*errp) {
-        error_report_err(*errp);
+        error_reportf_err(*errp, "Error: ");
     }
 }