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 <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa committed 2026-02-12 16:45:34 +01:00
1 parent ed94a8336a
commit 6f372d526f
1 file changed
+4 -7
+4 -7
View File
@@ -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;
}