]> xenbits.xensource.com Git - libvirt.git/commitdiff
tests: nodeinfotest: Remove virSaveLastError() usage
authorCole Robinson <crobinso@redhat.com>
Thu, 19 May 2016 19:25:10 +0000 (15:25 -0400)
committerCole Robinson <crobinso@redhat.com>
Thu, 19 May 2016 19:25:10 +0000 (15:25 -0400)
It's overkill here, we can use virGetLast* instead

tests/nodeinfotest.c

index d8eace5bf077397cd43e08e37cca69addc7ad799..03500fba97e21a00745821e495b5486ed707a4fe 100644 (file)
@@ -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;