[PATCH] virsystemd: Fix error check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit b3e4401dc620 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: b3e4401dc620 ("systemd: don't report an error if the guest is
already terminated")

Signed-off-by: Marc Hartmayer <mhartmay@xxxxxxxxxxxxxxxxxx>
Reviewed-by: Sascha Silbe <silbe@xxxxxxxxxxxxxxxxxx>
Reviewed-by: Boris Fiuczynski <fiuczy@xxxxxxxxxxxxxxxxxx>
---
 src/util/virsystemd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c
index 7d6985b..604dcdd 100644
--- a/src/util/virsystemd.c
+++ b/src/util/virsystemd.c
@@ -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);
-- 
2.5.5

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]