[libvirt] [PATCH 2/7] tests: Prefer virGetLastErrorMessage in testSELinuxLabeling

John Ferlan jferlan at redhat.com
Mon Oct 10 15:42:13 UTC 2016


Yet another case of not needing virGetLastError processing

Signed-off-by: John Ferlan <jferlan at redhat.com>
---
 tests/securityselinuxlabeltest.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/tests/securityselinuxlabeltest.c b/tests/securityselinuxlabeltest.c
index e98d9bb..1178acf 100644
--- a/tests/securityselinuxlabeltest.c
+++ b/tests/securityselinuxlabeltest.c
@@ -331,10 +331,8 @@ testSELinuxLabeling(const void *opaque)
         VIR_FREE(files[i].context);
     }
     VIR_FREE(files);
-    if (ret < 0) {
-        virErrorPtr err = virGetLastError();
-        VIR_TEST_VERBOSE("%s\n", err ? err->message : "<unknown>");
-    }
+    if (ret < 0)
+        VIR_TEST_VERBOSE("%s\n", virGetLastErrorMessage());
     return ret;
 }
 
-- 
2.7.4




More information about the libvir-list mailing list