glib: add compatibility interface for g_get_monotonic_time()
commit89b516d8b9444ece8ccabb322a9389587c7a7b83
authorStefan Hajnoczi <stefanha@redhat.com>
Wed, 15 Oct 2014 12:29:30 +0000 (15 14:29 +0200)
committerPeter Maydell <peter.maydell@linaro.org>
Wed, 15 Oct 2014 12:43:35 +0000 (15 13:43 +0100)
tree8b0c3c1356d83914dfbf2bbd666a720596b87d20
parent32d9c5613e3cbb5d90daa3a1c629fb389e749d03
glib: add compatibility interface for g_get_monotonic_time()

This patch fixes compilation errors when building against glib <2.28.0
due to the missing g_get_monotonic_time() function.

The compilation error in tests/libqos/virtio.c was introduced in commit
70556264a89a268efba1d7e8e341adcdd7881eb4 ("libqos: use microseconds
instead of iterations for virtio timeout").

Add a simple g_get_monotonic_time() implementation to glib-compat.h
based on code from vhost-user-test.c.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
[Igor: add G_TIME_SPAN_SECOND, include glib-compat.h in libqtest.h]
Signed-off-by: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
include/glib-compat.h
tests/libqtest.h
tests/vhost-user-test.c