mirror of https://gitee.com/openkylin/libvirt.git
qemuagenttest: Fix checking of shutdown mode
Coverity complained about unused variable that contains the shutdown mode. The original intention was to check it against the requested mode. Also the fixed check revealed a mistake in the expected shutdown mode. Reported by John Ferlan.
This commit is contained in:
parent
4ac708f250
commit
baebb34120
|
@ -251,6 +251,13 @@ qemuAgentShutdownTestMonitorHandler(qemuMonitorTestPtr test,
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (STRNEQ(mode, data->mode)) {
|
||||||
|
ret = qemuMonitorReportError(test,
|
||||||
|
"expected shutdown mode '%s' got '%s'",
|
||||||
|
data->mode, mode);
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
/* now don't reply but return a qemu agent event */
|
/* now don't reply but return a qemu agent event */
|
||||||
qemuAgentNotifyEvent(qemuMonitorTestGetAgent(test),
|
qemuAgentNotifyEvent(qemuMonitorTestGetAgent(test),
|
||||||
data->event);
|
data->event);
|
||||||
|
@ -279,7 +286,7 @@ testQemuAgentShutdown(const void *data)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
priv.event = QEMU_AGENT_EVENT_SHUTDOWN;
|
priv.event = QEMU_AGENT_EVENT_SHUTDOWN;
|
||||||
priv.mode = "shutdown";
|
priv.mode = "halt";
|
||||||
|
|
||||||
if (qemuMonitorTestAddHandler(test, qemuAgentShutdownTestMonitorHandler,
|
if (qemuMonitorTestAddHandler(test, qemuAgentShutdownTestMonitorHandler,
|
||||||
&priv, NULL) < 0)
|
&priv, NULL) < 0)
|
||||||
|
|
Loading…
Reference in New Issue