Commit Graph

113 Commits

Author SHA1 Message Date
Christophe Fergeau
c1b7f67b82 Add reference counting to PipeItem class
A user-defined callback is called when the refcount drops to 0.

Reference counting is manually coded for several classes deriving from
PipeItem, so this change will help to share this code, and allow to remove
some ref/unref virtual functions in some interfaces when we can assume
every instance derives from this base class.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-04-15 09:50:18 -05:00
Frediano Ziglio
5916dd8fa6 rename red-dispatcher.* files to red-qxl.*
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-03-04 15:27:41 +00:00
Jonathon Jongsma
1438b7ccf2 Add GObject to build requirements
Preparation for GObject-ifying some internals

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-02-16 11:22:04 +00:00
Frediano Ziglio
1020736efd worker: use glib main loop
Use the glib mainloop instead of writing our own. The glib loop is both
cleaner to use and is more extensible. It is also very mature and
reduces the maintenance burden on the spice server.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-01-28 16:16:50 +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
Frediano Ziglio
f3a7befafe tests: extract code for event loop
This code will be reused for main loop

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-01-19 23:56:33 +00:00
Marc-Andre Lureau
2628197b99 build-sys: build a utility libserver.la
This allow tests programs to link with statically built library to access all symbols

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-01-14 10:53:25 +00:00
Christophe Fergeau
10377fa065 build: Don't list some installed headers twice
Since commit febaed3, spice.h and spice-experimental.h are listed both
in libspice_server_la_HEADERS and libspice_server_la_SOURCES. Since we
want these headers to be installed, we can remove them from _SOURCES.

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-12-14 12:27:09 +00:00
Frediano Ziglio
febaed3529 server: misc header cleanups
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-12-09 22:17:51 +00:00
Frediano Ziglio
24da6bcd37 server: merge spice-bitmap-utils and spice_bitmap_utils
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-12-09 22:16:10 +00:00
Jonathon Jongsma
0410c6f165 remove glz_encoder_config.h
Move all code from glz_encoder_config.h into other files.

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-12-04 11:57:18 +00:00
Frediano Ziglio
525cd67be7 server: rename files
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-12-03 23:54:32 +00:00
Marc-André Lureau
d793473e5e server: cleanups
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-27 11:49:56 +00:00
Marc-André Lureau
203b3cdebf worker: move dcc_send & marshallers to dcc-send.c
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-11-27 11:41:51 +00:00
Marc-André Lureau
82fa233fa6 server: rename _tmpl files
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-26 13:33:36 +00:00
Marc-André Lureau
029b4beb73 worker: move dcc_add_surface_area_image
Author:    Marc-André Lureau <marcandre.lureau@gmail.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-11-23 13:50:44 +00:00
Marc-André Lureau
c5c176a5c7 server: remove OpenGL
This is really not supported, requires X11, so better to remove it for
now. Some day it might be revived, using DRM, ..

Note for later, this could be removed too (not used by client):
- spice-common/common/ogl_ctx

Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-21 13:50:46 +00:00
Marc-André Lureau
85920bb2e9 worker: start a DisplayChannelClient unit
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-19 12:43:02 +00:00
Marc-André Lureau
e8d8ff458b worker: move encoders to dcc-encoders
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-19 10:26:45 +00:00
Marc-André Lureau
885557f117 worker: move stream functions to a new stream.c file
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-10 16:09:28 +00:00
Marc-André Lureau
1e4abdc15d worker: move stream definitions to a new stream.h file
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
2015-11-10 16:06:08 +00:00
Marc-André Lureau
23e17c2fc9 server: move bitmap related to spice-bitmap-utils
Also remove some unused function parameters from
bitmap_get_graduality_level()

Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-11-03 16:32:26 +00:00
Marc-André Lureau
7198a06433 server: move display_channel_client_create() to dcc_new()
Move function from server/red_worker.c to new server/display-channel.c.

Acked-by: Fabiano Fidêncio <fidencio@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-11-02 14:00:54 +00:00
Marc-André Lureau
372eb0072a tree: move that to a separate unit
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-11-02 12:12:14 +00:00
Marc-André Lureau
39b7e55ec7 Replace now() with get_mononotonic_time()
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-10-29 18:22:19 +00:00
Marc-André Lureau
93414b23fa utils: add red_get_monotonic_time() 2015-10-29 17:59:02 +00:00
Marc-André Lureau
3c1ab4a5fa Move red_bitmap_utils.h->tmpl.c
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-10-29 11:27:09 +00:00
Marc-André Lureau
070e0fcd63 worker: move some cursor code to cursor-channel.c
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-10-29 09:58:25 +00:00
Marc-André Lureau
e87b09a510 server: split cache-item.h
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-10-23 16:32:57 +01:00
Marc-André Lureau
f99fac0f42 server: start separate display/cursor channel headers
Just move some declarations around

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-10-23 16:32:47 +01:00
Christophe Fergeau
d88b1fee74 build-sys: Adjust to new spice-common spice-deps.m4
This commit also updates the spice-common submodule

Christophe Fergeau (7):
      Add marshaller test case
      build-sys: Use ${PKG_CONFIG} rather than pkg-config
      build-sys: Rework SPICE_CHECK_* m4 macros
      build-sys: Add gio-2.0 to SPICE_CHECK_GLIB2
      build-sys: Fix error in SPICE_CHECK_LZ4 description
      build-sys: Set automake conditional in SPICE_CHECK_SMARTCARD
      build-sys: Rename SUPPORT_GL to HAVE_GL

Javier Celaya (1):
      Fix linearization of several marshallers with one item

Lukas Venhoda (3):
      ssl-verify: Only check addr length when using IP addr
      m4: Require glib version >= 2.22
      ssl-verify: Changed IPv4 hostname to IPv6
2015-10-23 14:35:14 +02:00
Marc-André Lureau
0facd6fc9e server: rename red_client_cache.h to cache_item.tmpl.c
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-10-20 14:00:25 +01:00
Marc-André Lureau
b15527e063 server: move some pixmap cache code in own file
Remove that hideous template header that should really be regular code
since it's specialized and instanciated only for pixmap.

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-10-19 13:08:21 +01:00
Christophe Fergeau
92c618f536 build-sys: Add missing header files to _SOURCES
2 newly-added header files were not added to _SOURCES, breaking make
distcheck.

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2015-09-01 14:21:04 +01:00
Christophe Fergeau
09394e857f build-sys: Remove test_spice_version.h
This script was used at make distcheck time to verify consistency of the
version number defined in configure.ac and in spice-server headers.
Since commit ab12cf414c, these 2 version numbers can no longer be out of
sync, so we can drop this script.
2015-08-26 11:01:09 +02:00
Christophe Fergeau
2e88eb705b server: Readd spice-experimental.h
Commit 3c6b4e41 removed spice-experimental.h as this header was not
used, nor supposed to be used. However, QEMU had been including it
(without using any of its symbols) until commit v2.3.0-rc0~135^2~1

As this is fairly recent (Nov 2014), building older QEMUs with new
spice-server releases, or even bisecting QEMU will be broken as they
will be looking for a no-longer available header.

This commit readds a spice-experimental.h file, however it only contains
a #warning indicating this file is deprecated. This means older QEMU
will build now, but only if they were configured with --disable-werror.
2015-08-26 11:01:09 +02:00
Alon Levy
3c7026b180 server/red_{record, replay}.[ch]: introduce
Currently hand crafted with some sed scripts and alot of vim macros from
red_parse_qxl after considering the logger in qemu/hw/qxl-logger.c and seeing
it was incomplete. The only problem with logging from the server and
not from qemu is that it requires coordinated shutdown to avoid half a message.

Should be automatically generated from a declarative syntax, i.e. qxl.proto.

Note: zlib compression is introduced in a disabled state, see ZLIB
define

Now with a simple versioned header and generated ids by the server
instead of based on the recorded file, and doesn't use more then 1024
surfaces (configurable).

Signed-off-by: Alon Levy <alon@pobox.com>
Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
2015-08-21 09:38:44 +01:00
Christophe Fergeau
5acc017638 build-sys: Remove spice-protocol submodule
It's seeing regular releases and is API stable, so we don't need to
bundle it with spice-server
2015-08-20 12:30:55 +01:00
Marc-André Lureau
3c6b4e415f Remove spice-experimental
Remove unneded symbols that nobody should be using anyway.
ABI is modified with this patch, but the library version is not bumped.
2015-01-15 18:34:26 +01:00
Javier Celaya
b532ef0866 Add LZ4 compression support.
- Add lz4 encoder to compress an image of type LZ4 (see spice_common).
- Add code in red_worker to use LZ4 when it is enabled, and the client
  supports it through its display capability, or fallback to LZ.
- Add enable_lz4 switch in the configure script. Show LZ4 support at the
  end.
2014-12-02 19:41:17 +01:00
Marc-André Lureau
6f798ba1f7 Split spice.h
Make it easier to read the Spice server API.
2014-11-27 14:27:18 +01:00
Christophe Fergeau
8b347a641c Add reds_stream.[ch]
Gather common RedsStream code there rather than having it
in reds.c
2014-01-20 12:15:41 +01:00
Jeremy White
4c7c0ef3a7 Revise the spice client and server to use the new snd_codec functions in spice-common.
This makes celt optional, and paves the way to readily add additional codecs.

Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2014-01-02 12:34:34 +01:00
Christophe Fergeau
1b77a2c073 Add red_time.h to Makefile.am
This file was added in bc50ff076 a few months ago, but is not listed
in Makefile.am, and thus not part of tarballs. However, it's being included
from other C files, so not having it causes compilation breakage.
2013-12-11 16:45:50 +01:00
Christophe Fergeau
ef9a8bf053 Remove tunneling support
It's depending on an unmaintained package (slirp), and I don't
think anyone uses that code. It's not tested upstream nor in fedora,
so let's remove it.
2013-10-28 11:12:27 +01:00
Christophe Fergeau
ceb672bf85 Use hardened linker flags if available
This commit reuse several macros from libvirt to test for
support for "-Wl,-z -Wl,relro", "-Wl,-z -Wl,now" and
"-Wl,--no-copy-dt-needed-entries", and use them if available.
2013-10-10 11:17:52 +02:00
Marc-André Lureau
fe0941fb02 server: mark deprecated symbols 2013-10-07 16:33:20 +02:00
Alon Levy
ee382109a6 server: split spice_image_cache from red_worker 2013-08-14 12:08:04 +03:00
Alon Levy
fe38ddf724 server: move bit set/clear utilities out of red_worker.h 2013-08-14 12:08:04 +03:00
Alon Levy
376264b009 server: move dump_bitmap to separate file 2013-08-14 12:08:04 +03:00