diff mbox

tests: nodeinfotest: Remove virSaveLastError() usage

Message ID ee814d0ec4805bb0663cc0f87a450cb7a59fe6d9.1463686028.git.crobinso@redhat.com
State Accepted
Commit ee814d0ec4805bb0663cc0f87a450cb7a59fe6d9
Headers show

Commit Message

Cole Robinson May 19, 2016, 7:27 p.m. UTC
It's overkill here, we can use virGetLast* instead
---
 tests/nodeinfotest.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

-- 
2.7.4

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

Patch

diff --git a/tests/nodeinfotest.c b/tests/nodeinfotest.c
index d8eace5..03500fb 100644
--- a/tests/nodeinfotest.c
+++ b/tests/nodeinfotest.c
@@ -44,10 +44,8 @@  linuxTestCompareFiles(char *sysfs_prefix,
     memset(&nodeinfo, 0, sizeof(nodeinfo));
     if (linuxNodeInfoCPUPopulate(sysfs_prefix, cpuinfo, arch, &nodeinfo) < 0) {
         if (virTestGetDebug()) {
-            virErrorPtr error = virSaveLastError();
-            if (error && error->code != VIR_ERR_OK)
-                VIR_TEST_DEBUG("\n%s\n", error->message);
-            virFreeError(error);
+            if (virGetLastError())
+                VIR_TEST_DEBUG("\n%s\n", virGetLastErrorMessage());
         }
         VIR_FORCE_FCLOSE(cpuinfo);
         goto fail;