hal/hald/linux2/addons addon-acpi.c, 1.5, 1.6 addon-hid-ups.c, 1.4,
1.5 addon-storage.c, 1.4, 1.5 addon-usb-csr.c, 1.2, 1.3
David Zeuthen
david at freedesktop.org
Fri Apr 8 11:10:22 PDT 2005
- Previous message: hal/hald hald.c, 1.32, 1.33 hald_dbus.c, 1.32, 1.33 hald_dbus.h, 1.6,
1.7 util.c, 1.13, 1.14
- Next message: hal/tools fstab-sync.c,1.32,1.33
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvs/hal/hal/hald/linux2/addons
In directory gabe:/tmp/cvs-serv32581/hald/linux2/addons
Modified Files:
addon-acpi.c addon-hid-ups.c addon-storage.c addon-usb-csr.c
Log Message:
2005-04-08 David Zeuthen <davidz at redhat.com>
Make all hal helpers use a direct connection to hald rather than
going through the bus. This is for both performance and security
reasons. Also, fix the reconnect issue and don't connect to the
system message bus before probing is done.
* configure.in: Require dbus 0.33; that, for now, means D-BUS CVS
HEAD since it requires the patch in fd.o bug #2889 and D-BUS made
a post-release version bump. I'll look into doing a D-BUS release
soon.
* libhal/libhal.h: Export prototype for libhal_ctx_init_direct()
* libhal/libhal.c (libhal_ctx_init_direct): New convenience function
for connecting directly to hald instead of going through the message
bus (requires the address in the HALD_DIRECT_ADDR environment variable)
* hald/util.c (hal_util_helper_invoke): Export the local hald dbus
server address in HALD_DIRECT_ADDR
* hald/hald_dbus.c (manager_send_signal_device_added): Handle the
case where we're not connected to the system message bus
(manager_send_signal_device_removed): -do-
(manager_send_signal_new_capability): -do-
(device_property_atomic_update_end): -do-
(device_send_signal_property_modified): -do-
(device_send_signal_condition): -do-
(device_set_property): Always allow local interface
(device_add_capability): -do-
(device_remove_property): -do-
(device_rescan): -do-
(device_reprobe): -do-
(device_emit_condition): -do-
(hald_dbus_filter_handle_methods): New function
(hald_dbus_filter_function): Move bulk of functionality to the new
hald_dbus_filter_handle_methods() and pass local_interface==FALSE.
Handle Disconnect from local libdbus properly and attempt to
reconnect to the system message bus every so often (every 3 secs)
(local_server_message_handler): New function
(local_server_unregister_handler): New function
(local_server_handle_connection): New function
(hald_dbus_local_server_addr): New function
(hald_dbus_local_server_init): New function
* hald/hald.c (main): Register a local dbus server instead of
connection to the system bus as startup
(osspec_probe_done): Only connect to the system bus once probing
is done
* tools/fstab-sync.c (main): Use direct connection
* hald/linux2/probing/probe-volume.c (main): Use direct connection
* hald/linux2/probing/probe-storage.c (main): Use direct connection
* hald/linux2/probing/probe-smbios.c (main): Use direct connection
* hald/linux2/probing/probe-printer.c (main): Use direct connection
* hald/linux2/probing/probe-hiddev.c (main): Use direct connection
* hald/linux2/probing/probe-input.c (main): Use direct connection
* hald/linux2/addons/addon-usb-csr.c (main): Use direct connection
* hald/linux2/addons/addon-storage.c (main): Use direct connection
* hald/linux2/addons/addon-hid-ups.c (main): Use direct connection
* hald/linux2/addons/addon-acpi.c (main): Use direct connection
* hald/linux2/probing/probe-pc-floppy.c (main): Remove all references
to hal and dbus since this program just returns the result in the
exit code
Index: addon-acpi.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/addons/addon-acpi.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- addon-acpi.c 11 Mar 2005 22:42:34 -0000 1.5
+++ addon-acpi.c 8 Apr 2005 18:10:20 -0000 1.6
@@ -106,14 +106,7 @@
is_verbose = TRUE;
dbus_error_init (&error);
- if ((conn = dbus_bus_get (DBUS_BUS_SYSTEM, &error)) == NULL)
- goto out;
-
- if ((ctx = libhal_ctx_new ()) == NULL)
- goto out;
- if (!libhal_ctx_set_dbus_connection (ctx, conn))
- goto out;
- if (!libhal_ctx_init (ctx, &error))
+ if ((ctx = libhal_ctx_init_direct (&error)) == NULL)
goto out;
/* TODO: get mountpoint of proc from... /proc/mounts.. :-) */
Index: addon-hid-ups.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/addons/addon-hid-ups.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- addon-hid-ups.c 21 Mar 2005 00:08:01 -0000 1.4
+++ addon-hid-ups.c 8 Apr 2005 18:10:20 -0000 1.5
@@ -256,14 +256,7 @@
goto out;
dbus_error_init (&error);
- if ((conn = dbus_bus_get (DBUS_BUS_SYSTEM, &error)) == NULL)
- goto out;
-
- if ((ctx = libhal_ctx_new ()) == NULL)
- goto out;
- if (!libhal_ctx_set_dbus_connection (ctx, conn))
- goto out;
- if (!libhal_ctx_init (ctx, &error))
+ if ((ctx = libhal_ctx_init_direct (&error)) == NULL)
goto out;
device_file = getenv ("HAL_PROP_HIDDEV_DEVICE");
Index: addon-storage.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/addons/addon-storage.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- addon-storage.c 2 Mar 2005 19:19:13 -0000 1.4
+++ addon-storage.c 8 Apr 2005 18:10:20 -0000 1.5
@@ -182,14 +182,7 @@
support_media_changed = FALSE;
dbus_error_init (&error);
- if ((conn = dbus_bus_get (DBUS_BUS_SYSTEM, &error)) == NULL)
- goto out;
-
- if ((ctx = libhal_ctx_new ()) == NULL)
- goto out;
- if (!libhal_ctx_set_dbus_connection (ctx, conn))
- goto out;
- if (!libhal_ctx_init (ctx, &error))
+ if ((ctx = libhal_ctx_init_direct (&error)) == NULL)
goto out;
printf ("**************************************************\n");
Index: addon-usb-csr.c
===================================================================
RCS file: /cvs/hal/hal/hald/linux2/addons/addon-usb-csr.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- addon-usb-csr.c 4 Apr 2005 16:06:43 -0000 1.2
+++ addon-usb-csr.c 8 Apr 2005 18:10:20 -0000 1.3
@@ -398,7 +398,6 @@
the_device_udi = getenv ("UDI");
dbg ("device:[%s]\n", the_device_udi);
-
if (the_device_udi == NULL)
{
fprintf (stderr, "No device specified\n");
@@ -406,24 +405,8 @@
}
dbus_error_init (&err);
-
- if ((conn = dbus_bus_get (DBUS_BUS_SYSTEM, &err)) == NULL)
- {
- fprintf (stderr, "Could not obtain dbus connection\n");
- return -3;
- }
- dbg ("DBUS connection: %p\n", conn);
-
- hal_context = libhal_ctx_new ();
- if (!libhal_ctx_set_dbus_connection (hal_context, conn))
- {
- fprintf (stderr, "Could not bind to DBUS\n");
- return -4;
- }
- dbg ("New context: %p\n", hal_context);
-
- libhal_ctx_init (hal_context, &err);
- libhal_ctx_set_device_removed (hal_context, device_removed);
+ if ((ctx = libhal_ctx_init_direct (&err)) == NULL)
+ goto out;
update_properties ();
- Previous message: hal/hald hald.c, 1.32, 1.33 hald_dbus.c, 1.32, 1.33 hald_dbus.h, 1.6,
1.7 util.c, 1.13, 1.14
- Next message: hal/tools fstab-sync.c,1.32,1.33
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the hal-commit
mailing list