
On 04/12/2012 02:07 PM, Daniel P. Berrange wrote:
From: "Daniel P. Berrange" <berrange@redhat.com>
The policy kit and HAL node device drivers both require a DBus connection. The HAL device code further requires that the DBus connection is integrated with the event loop and provides such glue logic itself.
The forthcoming FirewallD integration also requires a dbus connection with event loop integration. Thus we need to pull the current event loop glue out of the HAL driver.
Thus we create src/util/virdbus.{c,h} files. This contains just one method virDBusGetSystemBus() which obtains a handle to the single shared system bus instance, with event glue automagically setup. --- .gitignore | 6 +- configure.ac | 37 ++++++- daemon/Makefile.am | 3 +- daemon/libvirtd.c | 4 - daemon/remote.c | 8 +- include/libvirt/virterror.h | 1 + src/Makefile.am | 13 +-- src/libvirt_dbus.syms | 2 -
You're dropping libvirt_dbus.syms, but I don't see where you are modifying libvirt_private.syms to make up for it.
src/node_device/node_device_hal.c | 143 ++------------------------ src/rpc/virnetserver.c | 40 -------- src/rpc/virnetserver.h | 8 -- src/util/virdbus.c | 201 +++++++++++++++++++++++++++++++++++++ src/util/virdbus.h | 34 ++++++ src/util/virterror.c | 3 + 14 files changed, 296 insertions(+), 207 deletions(-) delete mode 100644 src/libvirt_dbus.syms create mode 100644 src/util/virdbus.c create mode 100644 src/util/virdbus.h
+#ifndef __VIR_DBUS_H__ +# define __VIR_DBUS_H__ + +# ifdef HAVE_DBUS +# include <dbus/dbus.h> +# else +# define DBusConnection void
Is typedef any better than #define here? But this works. ACK with .syms nit fixed. -- Eric Blake eblake@redhat.com +1-919-301-3266 Libvirt virtualization library http://libvirt.org