[libvirt] [PATCH] small compilation problem with old dbus versions

dbus_watch_get_unix_fd() was added in dbus >= 1.1.1, it deprecate dbus_watch_get_fd(), so we should use the later if compiling against the old stuff, Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

On Fri, Dec 05, 2008 at 03:18:04PM +0100, Daniel Veillard wrote:
dbus_watch_get_unix_fd() was added in dbus >= 1.1.1, it deprecate dbus_watch_get_fd(), so we should use the later if compiling against the old stuff,
- info->watch = virEventAddHandle(dbus_watch_get_unix_fd(watch), flags, - dbus_watch_callback, watch, NULL); +#if (DBUS_VERSION_MAJOR == 1 && DBUS_VERSION_MINOR == 1 && DBUS_VERSION_MICRO >= 1) || (DBUS_VERSION_MAJOR == 1 && DBUS_VERSION_MAJOR > 1) || (DBUS_VERSION_MAJOR > 1)
This conditional is rather painful to read. I think we'd be better off just explicitly checking for the function In configure where we already have the HALL check old_CFLAGS=$CFLAGS old_LDFLAGS=$LDFLAGS CFLAGS="$CFLAGS $HAL_CFLAGS" LDFLAGS="$LDFLAGS $HAL_LIBS" AC_CHECK_FUNCS([libhal_get_all_devices],,[with_hal=no]) CFLAGS="$old_CFLAGS" LDFLAGS="$old_LDFLAGS" Change to old_CFLAGS=$CFLAGS old_LDFLAGS=$LDFLAGS CFLAGS="$CFLAGS $HAL_CFLAGS" LDFLAGS="$LDFLAGS $HAL_LIBS" AC_CHECK_FUNCS([libhal_get_all_devices],,[with_hal=no]) AC_CHECK_FUNCS([dbus_watch_get_unix_fd]) CFLAGS="$old_CFLAGS" LDFLAGS="$old_LDFLAGS" So we can then just do #if HAVE_DBUS_WATCH_GET_UNIX_FD
+ fd = dbus_watch_get_unix_fd(watch); +#else + fd = dbus_watch_get_fd(watch); +#endif + info->watch = virEventAddHandle(fd, flags, dbus_watch_callback, + watch, NULL); if (info->watch < 0) { VIR_FREE(info); return 0;
Daniel -- |: Red Hat, Engineering, London -o- http://people.redhat.com/berrange/ :| |: http://libvirt.org -o- http://virt-manager.org -o- http://ovirt.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: GnuPG: 7D3B9505 -o- F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

On Fri, Dec 05, 2008 at 02:31:17PM +0000, Daniel P. Berrange wrote:
On Fri, Dec 05, 2008 at 03:18:04PM +0100, Daniel Veillard wrote:
dbus_watch_get_unix_fd() was added in dbus >= 1.1.1, it deprecate dbus_watch_get_fd(), so we should use the later if compiling against the old stuff,
- info->watch = virEventAddHandle(dbus_watch_get_unix_fd(watch), flags, - dbus_watch_callback, watch, NULL); +#if (DBUS_VERSION_MAJOR == 1 && DBUS_VERSION_MINOR == 1 && DBUS_VERSION_MICRO >= 1) || (DBUS_VERSION_MAJOR == 1 && DBUS_VERSION_MAJOR > 1) || (DBUS_VERSION_MAJOR > 1)
This conditional is rather painful to read. I think we'd be better off just explicitly checking for the function
In configure where we already have the HALL check
Sure, a bit easier to read, thanks ! commited, Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/

dbus_watch_get_unix_fd() was added in dbus >= 1.1.1, it deprecate dbus_watch_get_fd(), so we should use the later if compiling against the old stuff,
hmm, somehow this problem and the solutions seems familiar to me: https://bugzilla.redhat.com/show_bug.cgi?id=473510 closed that bug now. Every project has its own way of working with small fixes and patches, some projects prefer the bugtracker, others the mailinglist. It seems like for libvirt the mailinglist is the way to go... Kind regards, Gerd

On Fri, Dec 05, 2008 at 05:24:18PM +0100, Gerd v. Egidy wrote:
dbus_watch_get_unix_fd() was added in dbus >= 1.1.1, it deprecate dbus_watch_get_fd(), so we should use the later if compiling against the old stuff,
hmm, somehow this problem and the solutions seems familiar to me:
https://bugzilla.redhat.com/show_bug.cgi?id=473510
closed that bug now.
Oops I didn't noticed it ... my fault !
Every project has its own way of working with small fixes and patches, some projects prefer the bugtracker, others the mailinglist. It seems like for libvirt the mailinglist is the way to go...
Well I think a mail to libvirt list get more attention, way more people who can fix problems or comment read posts here than the bugzilla (it's also way faster to read mail than query buzilla !), the main drawback is taht if nobody picked up your issue on the list it tends to be forgotten, while on bugzilla there is at least some regular checking over time. But for most issues, yes the list is way better, Daniel -- Daniel Veillard | libxml Gnome XML XSLT toolkit http://xmlsoft.org/ daniel@veillard.com | Rpmfind RPM search engine http://rpmfind.net/ http://veillard.com/ | virtualization library http://libvirt.org/
participants (3)
-
Daniel P. Berrange
-
Daniel Veillard
-
Gerd v. Egidy