qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] win32: use glib gpoll if glib >= 2.50
@ 2017-01-03 19:19 Marc-André Lureau
  2017-01-03 19:44 ` Stefan Weil
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Marc-André Lureau @ 2017-01-03 19:19 UTC (permalink / raw)
  To: qemu-devel; +Cc: sw, 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_DEBUG etc), and
hopefully has a better maintainance. Hopefully, we can drop the qemu
copy in a few years.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 include/glib-compat.h | 2 +-
 util/oslib-win32.c    | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/glib-compat.h b/include/glib-compat.h
index acf254d2a0..0cd24ffbe9 100644
--- a/include/glib-compat.h
+++ b/include/glib-compat.h
@@ -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.
diff --git a/util/oslib-win32.c b/util/oslib-win32.c
index d09863cc9d..0b1890fd33 100644
--- a/util/oslib-win32.c
+++ b/util/oslib-win32.c
@@ -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)
 {
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] win32: use glib gpoll if glib >= 2.50
  2017-01-03 19:19 [Qemu-devel] [PATCH] win32: use glib gpoll if glib >= 2.50 Marc-André Lureau
@ 2017-01-03 19:44 ` Stefan Weil
  2017-01-04 10:22 ` Daniel P. Berrange
  2017-01-12 11:22 ` Michael Tokarev
  2 siblings, 0 replies; 4+ messages in thread
From: Stefan Weil @ 2017-01-03 19:44 UTC (permalink / raw)
  To: Marc-André Lureau, qemu-devel, QEMU Trivial

On 01/03/17 20:19, Marc-André Lureau wrote:
> 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.
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  include/glib-compat.h | 2 +-
>  util/oslib-win32.c    | 2 ++
>  2 files changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/include/glib-compat.h b/include/glib-compat.h
> index acf254d2a0..0cd24ffbe9 100644
> --- a/include/glib-compat.h
> +++ b/include/glib-compat.h
> @@ -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.
> diff --git a/util/oslib-win32.c b/util/oslib-win32.c
> index d09863cc9d..0b1890fd33 100644
> --- a/util/oslib-win32.c
> +++ b/util/oslib-win32.c
> @@ -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)
>  {
>

Thanks for this patch.
I think it can be applied via qemu-trivial (cc'ed).

Reviewed-by: Stefan Weil <sw@weilnetz.de>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] win32: use glib gpoll if glib >= 2.50
  2017-01-03 19:19 [Qemu-devel] [PATCH] win32: use glib gpoll if glib >= 2.50 Marc-André Lureau
  2017-01-03 19:44 ` Stefan Weil
@ 2017-01-04 10:22 ` Daniel P. Berrange
  2017-01-12 11:22 ` Michael Tokarev
  2 siblings, 0 replies; 4+ messages in thread
From: Daniel P. Berrange @ 2017-01-04 10:22 UTC (permalink / raw)
  To: Marc-André Lureau; +Cc: qemu-devel, sw

On Tue, Jan 03, 2017 at 08:19:33PM +0100, Marc-André Lureau wrote:
> 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.

> 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.
> 
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
>  include/glib-compat.h | 2 +-
>  util/oslib-win32.c    | 2 ++
>  2 files changed, 3 insertions(+), 1 deletion(-)

Reviewed-by: Daniel P. Berrange <berrange@redhat.com>


Regards,
Daniel
-- 
|: 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/ :|

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] win32: use glib gpoll if glib >= 2.50
  2017-01-03 19:19 [Qemu-devel] [PATCH] win32: use glib gpoll if glib >= 2.50 Marc-André Lureau
  2017-01-03 19:44 ` Stefan Weil
  2017-01-04 10:22 ` Daniel P. Berrange
@ 2017-01-12 11:22 ` Michael Tokarev
  2 siblings, 0 replies; 4+ messages in thread
From: Michael Tokarev @ 2017-01-12 11:22 UTC (permalink / raw)
  To: Marc-André Lureau, qemu-devel; +Cc: sw, QEMU Trivial

03.01.2017 22:19, Marc-André Lureau wrote:
> 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.

Applied to -trivial, thank you!

/mjt

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-01-12 11:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-03 19:19 [Qemu-devel] [PATCH] win32: use glib gpoll if glib >= 2.50 Marc-André Lureau
2017-01-03 19:44 ` Stefan Weil
2017-01-04 10:22 ` Daniel P. Berrange
2017-01-12 11:22 ` Michael Tokarev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).