[PATCH] tests: virtnettlscontexttest: Use virGetLastErrorMessage()

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

 



Use virGetLastErrorMessage() rather than open code it
---
There's many more examples of this spread around the code; this patch
is meant as an example for http://wiki.libvirt.org/page/BiteSizedTasks

 tests/virnettlscontexttest.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/tests/virnettlscontexttest.c b/tests/virnettlscontexttest.c
index a3e24a3..d33b896 100644
--- a/tests/virnettlscontexttest.c
+++ b/tests/virnettlscontexttest.c
@@ -90,13 +90,12 @@ static int testTLSContextInit(const void *opaque)
             goto cleanup;
         }
     } else {
-        virErrorPtr err = virGetLastError();
         if (!data->expectFail) {
             VIR_WARN("Unexpected failure %s against %s",
                      data->cacrt, data->crt);
             goto cleanup;
         }
-        VIR_DEBUG("Got error %s", err ? err->message : "<unknown>");
+        VIR_DEBUG("Got error %s", virGetLastErrorMessage());
     }
 
     ret = 0;
-- 
2.5.0

--
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]