From: Peter Krempa <[email protected]>

Report both missing 'status' and invalid value in a single error
message. Also use the proper spelling of the event name (all caps).

Signed-off-by: Peter Krempa <[email protected]>
---
 src/qemu/qemu_monitor_json.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/qemu/qemu_monitor_json.c b/src/qemu/qemu_monitor_json.c
index 1b05c713ea..021995f5cc 100644
--- a/src/qemu/qemu_monitor_json.c
+++ b/src/qemu/qemu_monitor_json.c
@@ -1268,13 +1268,10 @@ qemuMonitorJSONHandleMigrationStatus(qemuMonitor *mon,
     const char *str;
     int status;

-    if (!(str = virJSONValueObjectGetString(data, "status"))) {
-        VIR_WARN("missing status in migration event");
-        return;
-    }
-
-    if ((status = qemuMonitorMigrationStatusTypeFromString(str)) == -1) {
-        VIR_WARN("unknown status '%s' in migration event", str);
+    if (!(str = virJSONValueObjectGetString(data, "status")) ||
+        (status = qemuMonitorMigrationStatusTypeFromString(str)) == -1) {
+        VIR_WARN("Missing or unknown value '%s' of 'status' in 'MIGRATION' 
event",
+                 NULLSTR(str));
         return;
     }

-- 
2.53.0

Reply via email to