[libvirt] [PATCH] tests: work with older dbus

On RHEL 5, with dbus 1.1.2, compilation failed with: virsystemdmock.c: In function 'dbus_connection_send_with_reply_and_block': virsystemdmock.c:68: warning: implicit declaration of function 'dbus_message_set_serial' Fix this by instead bypassing all attempts to use a dbus serial. * tests/virsystemdmock.c (dbus_message_set_reply_serial): Add new override. (dbus_connection_send_with_reply_and_block): No longer bother with the serial. Signed-off-by: Eric Blake <eblake@redhat.com> --- I'm tempted to push this under the build-breaker rule, but it is still pending a review of this patch also for RHEL 5: https://www.redhat.com/archives/libvir-list/2013-August/msg00313.html tests/virsystemdmock.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/virsystemdmock.c b/tests/virsystemdmock.c index b6c3695..ded52d2 100644 --- a/tests/virsystemdmock.c +++ b/tests/virsystemdmock.c @@ -58,6 +58,12 @@ dbus_bool_t dbus_connection_set_watch_functions(DBusConnection *connection ATTRI return 1; } +dbus_bool_t dbus_message_set_reply_serial(DBusMessage *message ATTRIBUTE_UNUSED, + dbus_uint32_t serial ATTRIBUTE_UNUSED) +{ + return 1; +} + DBusMessage *dbus_connection_send_with_reply_and_block(DBusConnection *connection ATTRIBUTE_UNUSED, DBusMessage *message, int timeout_milliseconds ATTRIBUTE_UNUSED, @@ -65,8 +71,6 @@ DBusMessage *dbus_connection_send_with_reply_and_block(DBusConnection *connectio { DBusMessage *reply = NULL; - dbus_message_set_serial(message, 7); - if (getenv("FAIL_BAD_SERVICE")) reply = dbus_message_new_error(message, "org.freedesktop.systemd.badthing", -- 1.8.3.1

On Thu, Aug 08, 2013 at 03:05:25PM -0600, Eric Blake wrote:
On RHEL 5, with dbus 1.1.2, compilation failed with:
virsystemdmock.c: In function 'dbus_connection_send_with_reply_and_block': virsystemdmock.c:68: warning: implicit declaration of function 'dbus_message_set_serial'
Fix this by instead bypassing all attempts to use a dbus serial.
* tests/virsystemdmock.c (dbus_message_set_reply_serial): Add new override. (dbus_connection_send_with_reply_and_block): No longer bother with the serial.
Signed-off-by: Eric Blake <eblake@redhat.com> ---
I'm tempted to push this under the build-breaker rule, but it is still pending a review of this patch also for RHEL 5: https://www.redhat.com/archives/libvir-list/2013-August/msg00313.html
tests/virsystemdmock.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/tests/virsystemdmock.c b/tests/virsystemdmock.c index b6c3695..ded52d2 100644 --- a/tests/virsystemdmock.c +++ b/tests/virsystemdmock.c @@ -58,6 +58,12 @@ dbus_bool_t dbus_connection_set_watch_functions(DBusConnection *connection ATTRI return 1; }
+dbus_bool_t dbus_message_set_reply_serial(DBusMessage *message ATTRIBUTE_UNUSED, + dbus_uint32_t serial ATTRIBUTE_UNUSED) +{ + return 1; +} + DBusMessage *dbus_connection_send_with_reply_and_block(DBusConnection *connection ATTRIBUTE_UNUSED, DBusMessage *message, int timeout_milliseconds ATTRIBUTE_UNUSED, @@ -65,8 +71,6 @@ DBusMessage *dbus_connection_send_with_reply_and_block(DBusConnection *connectio { DBusMessage *reply = NULL;
- dbus_message_set_serial(message, 7); - if (getenv("FAIL_BAD_SERVICE")) reply = dbus_message_new_error(message, "org.freedesktop.systemd.badthing",
ACK, good idea for fixing this. Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|

On 08/08/2013 04:03 PM, Daniel P. Berrange wrote:
On Thu, Aug 08, 2013 at 03:05:25PM -0600, Eric Blake wrote:
On RHEL 5, with dbus 1.1.2, compilation failed with:
virsystemdmock.c: In function 'dbus_connection_send_with_reply_and_block': virsystemdmock.c:68: warning: implicit declaration of function 'dbus_message_set_serial'
Fix this by instead bypassing all attempts to use a dbus serial.
I'm tempted to push this under the build-breaker rule, but it is still pending a review of this patch also for RHEL 5: https://www.redhat.com/archives/libvir-list/2013-August/msg00313.html
Still awaiting review on that one...
ACK, good idea for fixing this.
...but this one is now pushed. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
participants (2)
-
Daniel P. Berrange
-
Eric Blake