1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-10-27 11:34:09 +03:00

tests: qemu: remove pointless labels

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Reviewed-by: Laine Stump <laine@redhat.com>
This commit is contained in:
Ján Tomko
2021-09-04 22:38:39 +02:00
parent 6150910cf7
commit 8e8603d24b
6 changed files with 51 additions and 105 deletions

View File

@@ -471,51 +471,39 @@ qemuAgentShutdownTestMonitorHandler(qemuMonitorTest *test,
virJSONValue *args;
const char *cmdname;
const char *mode;
int ret = -1;
data = qemuMonitorTestItemGetPrivateData(item);
if (!(val = virJSONValueFromString(cmdstr)))
return -1;
if (!(cmdname = virJSONValueObjectGetString(val, "execute"))) {
ret = qemuMonitorTestAddErrorResponse(test, "Missing command name in %s", cmdstr);
goto cleanup;
}
if (!(cmdname = virJSONValueObjectGetString(val, "execute")))
return qemuMonitorTestAddErrorResponse(test, "Missing command name in %s", cmdstr);
if (STRNEQ(cmdname, "guest-shutdown")) {
ret = qemuMonitorTestAddInvalidCommandResponse(test, "guest-shutdown",
return qemuMonitorTestAddInvalidCommandResponse(test, "guest-shutdown",
cmdname);
goto cleanup;
}
if (!(args = virJSONValueObjectGet(val, "arguments"))) {
ret = qemuMonitorTestAddErrorResponse(test,
return qemuMonitorTestAddErrorResponse(test,
"Missing arguments section");
goto cleanup;
}
if (!(mode = virJSONValueObjectGetString(args, "mode"))) {
ret = qemuMonitorTestAddErrorResponse(test, "Missing shutdown mode");
goto cleanup;
}
if (!(mode = virJSONValueObjectGetString(args, "mode")))
return qemuMonitorTestAddErrorResponse(test, "Missing shutdown mode");
if (STRNEQ(mode, data->mode)) {
ret = qemuMonitorTestAddErrorResponse(test,
return qemuMonitorTestAddErrorResponse(test,
"expected shutdown mode '%s' got '%s'",
data->mode, mode);
goto cleanup;
}
/* now don't reply but return a qemu agent event */
qemuAgentNotifyEvent(qemuMonitorTestGetAgent(test),
data->event);
ret = 0;
cleanup:
return ret;
return 0;
}