aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2009-11-13 10:36:01 +0000
committerDaniel P. Berrange <berrange@redhat.com>2009-11-13 15:10:55 +0000
commit7bed630dfbad2c42788c66506325375f825918ba (patch)
tree686d4dc7e21f65496e6c59f947099cee0e74ad51
parentFix cleanup when state driver init fails (diff)
downloadlibvirt-7bed630dfbad2c42788c66506325375f825918ba.tar.gz
libvirt-7bed630dfbad2c42788c66506325375f825918ba.tar.bz2
libvirt-7bed630dfbad2c42788c66506325375f825918ba.zip
Don't return fatal error in HAL driver init if HAL isn't running
The HAL driver returns a fatal error code in the case where HAL is not running. This causes the entire libvirtd daemon to quit which isn't desirable. Instead it should simply disable the HAL driver * src/node_device/node_device_hal.c: Quietly disable HAL if it is not running
-rw-r--r--src/node_device/node_device_hal.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/node_device/node_device_hal.c b/src/node_device/node_device_hal.c
index 918a3a9f1..1e1d872cd 100644
--- a/src/node_device/node_device_hal.c
+++ b/src/node_device/node_device_hal.c
@@ -692,6 +692,7 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED)
DBusError err;
char **udi = NULL;
int num_devs, i;
+ int ret = -1;
/* Ensure caps_tbl is sorted by capability name */
qsort(caps_tbl, ARRAY_CARDINALITY(caps_tbl), sizeof(caps_tbl[0]),
@@ -728,7 +729,11 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED)
goto failure;
}
if (!libhal_ctx_init(hal_ctx, &err)) {
- VIR_ERROR0("libhal_ctx_init failed\n");
+ VIR_ERROR0("libhal_ctx_init failed, haldaemon is probably not running\n");
+ /* We don't want to show a fatal error here,
+ otherwise entire libvirtd shuts down when
+ hald isn't running */
+ ret = 0;
goto failure;
}
@@ -787,7 +792,7 @@ static int halDeviceMonitorStartup(int privileged ATTRIBUTE_UNUSED)
nodeDeviceUnlock(driverState);
VIR_FREE(driverState);
- return -1;
+ return ret;
}