mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 15:27:47 +00:00
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 <jferlan@redhat.com>
This commit is contained in:
parent
f0187c1f27
commit
4fac5a9fd3
@ -695,9 +695,8 @@ networkStateInitialize(bool privileged,
|
|||||||
|
|
||||||
#ifdef HAVE_FIREWALLD
|
#ifdef HAVE_FIREWALLD
|
||||||
if (!(sysbus = virDBusGetSystemBus())) {
|
if (!(sysbus = virDBusGetSystemBus())) {
|
||||||
virErrorPtr err = virGetLastError();
|
|
||||||
VIR_WARN("DBus not available, disabling firewalld support "
|
VIR_WARN("DBus not available, disabling firewalld support "
|
||||||
"in bridge_network_driver: %s", err->message);
|
"in bridge_network_driver: %s", virGetLastErrorMessage());
|
||||||
} else {
|
} else {
|
||||||
/* add matches for
|
/* add matches for
|
||||||
* NameOwnerChanged on org.freedesktop.DBus for firewalld start/stop
|
* NameOwnerChanged on org.freedesktop.DBus for firewalld start/stop
|
||||||
|
@ -641,9 +641,8 @@ nodeStateInitialize(bool privileged ATTRIBUTE_UNUSED,
|
|||||||
|
|
||||||
dbus_error_init(&err);
|
dbus_error_init(&err);
|
||||||
if (!(sysbus = virDBusGetSystemBus())) {
|
if (!(sysbus = virDBusGetSystemBus())) {
|
||||||
virErrorPtr verr = virGetLastError();
|
|
||||||
VIR_ERROR(_("DBus not available, disabling HAL driver: %s"),
|
VIR_ERROR(_("DBus not available, disabling HAL driver: %s"),
|
||||||
verr->message);
|
virGetLastErrorMessage());
|
||||||
ret = 0;
|
ret = 0;
|
||||||
goto failure;
|
goto failure;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user