提交 cdf06553 编写于 作者: M Marc Hartmayer 提交者: Michal Privoznik

virsystemd: Fix error check

Commit b3e4401d introduced a check to ignore an error if the guest
is already terminated. However the check accidentally compared
error.code with VIR_ERR_ERROR, which is an error level, not an error
code. Because of this, almost every error got silently ignored.

Fixes: b3e4401d ("systemd: don't report an error if the guest is
already terminated")
Signed-off-by: NMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: NSascha Silbe <silbe@linux.vnet.ibm.com>
Reviewed-by: NBoris Fiuczynski <fiuczy@linux.vnet.ibm.com>
上级 7e1ca80d
......@@ -468,7 +468,7 @@ int virSystemdTerminateMachine(const char *name)
name) < 0)
goto cleanup;
if (error.code == VIR_ERR_ERROR &&
if (error.level == VIR_ERR_ERROR &&
STRNEQ_NULLABLE("org.freedesktop.machine1.NoSuchMachine",
error.str1)) {
virReportErrorObject(&error);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册