]> xenbits.xensource.com Git - libvirt.git/commitdiff
Use virGetLastErrorMessage to avoid Coverity message
authorJohn Ferlan <jferlan@redhat.com>
Thu, 5 May 2016 22:27:00 +0000 (18:27 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 9 May 2016 23:33:56 +0000 (19:33 -0400)
Both instances use VIR_WARN() to print the error from a failed
virDBusGetSystemBus() call.  Rather than use the virGetLastError
and need to check for valid return err pointer, just use the
virGetLastErrorMessage.

Signed-off-by: John Ferlan <jferlan@redhat.com>
src/network/bridge_driver.c
src/node_device/node_device_hal.c

index a34da2aac00557a98025ebcd45c585f42609a46f..f406f0431fd98e3bd683bc19bcde9b21658adcae 100644 (file)
@@ -695,9 +695,8 @@ networkStateInitialize(bool privileged,
 
 #ifdef HAVE_FIREWALLD
     if (!(sysbus = virDBusGetSystemBus())) {
-        virErrorPtr err = virGetLastError();
         VIR_WARN("DBus not available, disabling firewalld support "
-                 "in bridge_network_driver: %s", err->message);
+                 "in bridge_network_driver: %s", virGetLastErrorMessage());
     } else {
         /* add matches for
          * NameOwnerChanged on org.freedesktop.DBus for firewalld start/stop
index 6d18a8789b91aa622dd440468c60a58e61c50da4..6ddfad0ad4ebf28c07f3006cf17d51c859c47275 100644 (file)
@@ -641,9 +641,8 @@ nodeStateInitialize(bool privileged ATTRIBUTE_UNUSED,
 
     dbus_error_init(&err);
     if (!(sysbus = virDBusGetSystemBus())) {
-        virErrorPtr verr = virGetLastError();
         VIR_ERROR(_("DBus not available, disabling HAL driver: %s"),
-                    verr->message);
+                    virGetLastErrorMessage());
         ret = 0;
         goto failure;
     }