Commit Graph

11 Commits

Author SHA1 Message Date
Frediano Ziglio
ed68d491fd Do not check for HAVE_CONFIG_H
This should always be defined and including config.h is a requirement.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-04-30 09:26:55 +01:00
Frediano Ziglio
9bf95486e5 event-loop: Port to Windows
Use g_io_channel_win32_new_socket instead of g_io_channel_unix_new

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2019-01-31 11:06:37 +00:00
Frediano Ziglio
aac08a1642 event-loop: Avoid possible compiler warning
With GCC 8.0.1 (Fedora 28), cast to different function pointer
can lead to warnings, like:

  event-loop.c: In function ‘watch_update_mask’:
  event-loop.c:146:42: error: cast between incompatible function types from ‘gboolean (*)(GIOChannel *, GIOCondition,  void *)’ {aka ‘int (*)(struct _GIOChannel *, enum <anonymous>,  void *)’} to ‘gboolean (*)(void *)’ {aka ‘int (*)(void *)’} [-Werror=cast-function-type]
       g_source_set_callback(watch->source, (GSourceFunc)watch_func, watch, NULL);
                                          ^
  cc1: all warnings being treated as errors

As g_source_set_callback expect a function pointer which type
changes based on the type of source (so is expected) silent
the possible warning.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2018-05-10 22:30:52 +01:00
Frediano Ziglio
4b4647e2af event-loop: Use GLib memory functions
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2017-10-11 12:52:17 +01:00
Frediano Ziglio
1b4e8855ea Remove core_public and core_interface_adapter globals usage
Avoid not constant globals.

We started encapsulating all global state into RedsState however
there are still some global variable. This patch remove the
core_public global variable.

To implement this a new SpiceCoreInterface *public_interface
field is added to SpiceCoreInterfaceInternal and the
SpiceCoreInterfaceInternal* argument is passed to callbacks to
understand which external interface to use.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-11-15 16:49:09 +00:00
Christophe Fergeau
9c21b474c0 syntax-check: Add missing <config.h> includes
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-11-01 12:47:14 +00:00
Frediano Ziglio
c70b2067a9 Constify event_loop_core
Was used as write variable only for testing.
Avoid usage of not constant globals.
Making globals constants avoid future race condition
usages.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-06-29 08:08:54 +01:00
Frediano Ziglio
47223da1a3 revert new event-loop code for timers
Was causing sporadic crashes.
Also cause compatibility problems with RHEL 6.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-02-12 17:44:57 +00:00
Frediano Ziglio
7a11b96095 compatibility patch for event loop
This patch use old code to implement timer events.
The new version use some function from GLib 2.34 however some systems
(like RHEL 6) have former GLib version (RHEL 6 has GLib 2.28 installed)

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-02-03 13:27:16 +00:00
Frediano Ziglio
28e33ccdf0 worker: improved implementation of SpiceTimer
Use a custom GSource.
This to avoid having to allocate a timer all the time we add one.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-01-26 13:13:57 +00:00
Christophe Fergeau
6e407a81df event-loop: Remove template
Since SpiceCoreInterfaceInternal is a private data structure, we can
extend it as we see fit without breaking ABI. In particular, adding a
GMainContext member to it allows us to remove the need for
the event loop template which is currently included in the
basic_event_loop.c test file.

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-01-21 14:19:24 +00:00