libvirt/libvirt-0.6.0-dbus-threads.patch
Daniel P. Berrange 8baff3185c Fix QEMU startup timeout/race (rhbz #484649)
Setup DBus threading. Don't allow dbus to call _exit / change SIGPIPE (rhbz #484553)
Fix timeout when autostarting session daemon
2009-02-18 14:15:19 +00:00

45 lines
1.8 KiB
Diff

diff -rup libvirt-0.6.0.orig/qemud/qemud.c libvirt-0.6.0.new/qemud/qemud.c
--- libvirt-0.6.0.orig/qemud/qemud.c 2009-02-18 10:56:34.000000000 +0000
+++ libvirt-0.6.0.new/qemud/qemud.c 2009-02-18 12:52:18.000000000 +0000
@@ -860,6 +860,10 @@ static struct qemud_server *qemudNetwork
if (auth_unix_rw == REMOTE_AUTH_POLKIT ||
auth_unix_ro == REMOTE_AUTH_POLKIT) {
DBusError derr;
+
+ dbus_connection_set_change_sigpipe(FALSE);
+ dbus_threads_init_default();
+
dbus_error_init(&derr);
server->sysbus = dbus_bus_get(DBUS_BUS_SYSTEM, &derr);
if (!(server->sysbus)) {
@@ -868,6 +872,7 @@ static struct qemud_server *qemudNetwork
dbus_error_free(&derr);
goto cleanup;
}
+ dbus_connection_set_exit_on_disconnect(server->sysbus, FALSE);
}
#endif
diff -rup libvirt-0.6.0.orig/src/node_device_hal.c libvirt-0.6.0.new/src/node_device_hal.c
--- libvirt-0.6.0.orig/src/node_device_hal.c 2009-01-16 12:44:22.000000000 +0000
+++ libvirt-0.6.0.new/src/node_device_hal.c 2009-02-18 12:52:48.000000000 +0000
@@ -685,6 +685,9 @@ static int halDeviceMonitorStartup(void)
nodeDeviceLock(driverState);
/* Allocate and initialize a new HAL context */
+ dbus_connection_set_change_sigpipe(FALSE);
+ dbus_threads_init_default();
+
dbus_error_init(&err);
hal_ctx = libhal_ctx_new();
if (hal_ctx == NULL) {
@@ -696,6 +699,8 @@ static int halDeviceMonitorStartup(void)
fprintf(stderr, "%s: dbus_bus_get failed\n", __FUNCTION__);
goto failure;
}
+ dbus_connection_set_exit_on_disconnect(dbus_conn, FALSE);
+
if (!libhal_ctx_set_dbus_connection(hal_ctx, dbus_conn)) {
fprintf(stderr, "%s: libhal_ctx_set_dbus_connection failed\n",
__FUNCTION__);