From: Peter Krempa Date: Wed, 4 Feb 2026 09:47:53 +0000 (+0100) Subject: qemuMonitorJSONHandleMigrationStatus: Simplify error case X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f372d526f9a908275127001aaf89e42b1fdd565;p=thirdparty%2Flibvirt.git qemuMonitorJSONHandleMigrationStatus: Simplify error case 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 Reviewed-by: Ján Tomko --- 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; }