From 4fac5a9fd3d405ad821a4b84db36e6a440ce646e Mon Sep 17 00:00:00 2001 From: John Ferlan Date: Thu, 5 May 2016 18:27:00 -0400 Subject: [PATCH] Use virGetLastErrorMessage to avoid Coverity message 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 --- src/network/bridge_driver.c | 3 +-- src/node_device/node_device_hal.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index a34da2aac0..f406f0431f 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -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 diff --git a/src/node_device/node_device_hal.c b/src/node_device/node_device_hal.c index 6d18a8789b..6ddfad0ad4 100644 --- a/src/node_device/node_device_hal.c +++ b/src/node_device/node_device_hal.c @@ -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; }