win32: use glib gpoll if glib >= 2.50
PATCH 1/1 win32: use glib gpoll if glib >= 2.50
A fix has been committed in upstream glib commit 210a9796f78eb90f76f1bd6a304e9fea05e97617.
(See also related bug https://bugzilla.gnome.org/show_bug.cgi?id=764415)
It is desirable to use the glib version instead of qemu copy, since it provides more debugging facilities (G_MAIN_POLL_DEBUG etc), and hopefully has a better maintainance. Hopefully, we can drop the qemu copy in a few years.
--- include/glib-compat.h | 2 +- util/oslib-win32.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
include/glib-compat.h +1 -1
@@ -39,7 +39,7 @@ static inline gint64 qemu_g_get_monotonic_time(void)#define g_get_monotonic_time () qemu_g_get_monotonic_time()#endif -#ifdef _WIN32 +#if defined(_WIN32) && !GLIB_CHECK_VERSION (2 ,50 ,0 )/* * g_poll has a problem on Windows when using * timeouts < 10ms, so use wrapper.
util/oslib-win32.c +2 -0
@@ -327,6 +327,7 @@ char *qemu_get_exec_dir(void)return g_strdup (exec_dir); } +#if !GLIB_CHECK_VERSION (2 ,50 ,0 )/* * The original implementation of g_poll from glib has a problem on Windows * when using timeouts < 10 ms.
@@ -530,6 +531,7 @@ gint g_poll(GPollFD *fds, guint nfds, gint timeout) return retval; } +#endif int getpagesize (void ) {
Signature · 1 line
2.11.0
Quoted 42 lines · Marc-André Lureau
A fix has been committed in upstream glib commit
210a9796f78eb90f76f1bd6a304e9fea05e97617.
(See also related bug https://bugzilla.gnome.org/show_bug.cgi?id=764415)It is desirable to use the glib version instead of qemu copy, since it provides more debugging facilities (
G_MAIN_POLL_DEBUGetc), and hopefully has a better maintainance. Hopefully, we can drop the qemu copy in a few years.Signed-off-by Marc-André Lureau <[email protected]>--- include/glib-compat.h | 2 +- util/oslib-win32.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)include/glib-compat.h +1
-1@@ -39,7 +39,7 @@ static inline gint64 qemu_g_get_monotonic_time(void)#define g_get_monotonic_time () qemu_g_get_monotonic_time()#endif -#ifdef _WIN32 +#if defined(_WIN32) && !GLIB_CHECK_VERSION (2 ,50 ,0 )/* * g_poll has a problem on Windows when using * timeouts < 10ms, so use wrapper. util/oslib-win32.c +1
-0@@ -327,6 +327,7 @@ char *qemu_get_exec_dir(void)return g_strdup (exec_dir); } +#if !GLIB_CHECK_VERSION (2 ,50 ,0 )/* * The original implementation of g_poll from glib has a problem on Windows * when using timeouts < 10 ms.
util/oslib-win32.c gint g_poll(GPollFD *fds, guint nfds, gint timeout) · line 537
Quoted 7 lines
util/oslib-win32.c +1
-0@@ -530,6 +531,7 @@ gint g_poll(GPollFD *fds, guint nfds, gint timeout) return retval; } +#endif int getpagesize (void ) {
Thanks for this patch.
I think it can be applied via qemu-trivial (cc'ed).
Quoted 3 lines · Marc-André Lureau
A fix has been committed in upstream glib commit
210a9796f78eb90f76f1bd6a304e9fea05e97617.
(See also related bug https://bugzilla.gnome.org/show_bug.cgi?id=764415)
The bug is a little misleading because the comments indicate that patch was going to be merged to master after 2.50 branched. The git commit hash though shows it merged before branching
$ git describe 210a9796f78eb90f76f1bd6a304e9fea05e97617 2.48.0-41-g210a979
so the >= 2.50 check is good.
Quoted 10 lines
It is desirable to use the glib version instead of qemu copy, since it provides more debugging facilities (
G_MAIN_POLL_DEBUGetc), and hopefully has a better maintainance. Hopefully, we can drop the qemu copy in a few years.Signed-off-by Marc-André Lureau <[email protected]>--- include/glib-compat.h | 2 +- util/oslib-win32.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-)
Regards,
Daniel
Signature · 3 lines
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|
Michael Tokarev
AppliedQuoted 8 lines · Marc-André Lureau
A fix has been committed in upstream glib commit
210a9796f78eb90f76f1bd6a304e9fea05e97617.
(See also related bug https://bugzilla.gnome.org/show_bug.cgi?id=764415)It is desirable to use the glib version instead of qemu copy, since it provides more debugging facilities (
G_MAIN_POLL_DEBUGetc), and hopefully has a better maintainance. Hopefully, we can drop the qemu copy in a few years.
Applied to -trivial, thank you!
/mjt