mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
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:
1 parent
ed94a8336a
commit
6f372d526f
1 file changed
+4
-7
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user