Commit Graph

523 Commits

Author SHA1 Message Date
Christophe Fergeau
6ddcd5468a proto: Use proper type for preferred_compression field
No need to use an uint8 typed member, we can directly use the
appropriate enum8 type here, which makes everything more explicit.

(cherry picked from spice-protocol commit 8a3def14e35039753097094ba356e85e8fc2d128)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-04-14 14:33:57 +02:00
Christophe Fergeau
7fbb50cd8e proto: Rename image_compress to image_compression
Re-using the SPICE_IMAGE_COMPRESS_ prefix in newer spice-protocol
releases is going to cause issues as there will be clashing enum members
in older spice-server releases. Using SPICE_IMAGE_COMPRESSION_ as a
prefix sidesteps these backward compability issues.

(cherry picked from spice-protocol commit e857cd9a378cdf56805b64284491a12af93a7cbf)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-04-14 14:33:54 +02:00
Marc-André Lureau
78cab12336 Revert "Remove files moved to spice-protocol"
This reverts commit 7665dcf1bb.

Also revert the related build-sys changes to fix the build.

codegen generated code depends on spice-common code (marshaller,
messages etc), it makes more sense to keep the generator along
this. Otherwise a newer protocol release will fail to build older
projects.

*.proto files are required as well, since it generates code that parent
modules depend on unconditionnaly.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-04-14 14:33:50 +02:00
Frediano Ziglio
80cc3f680a ring: use NULL instead of 0 for null pointers
This is consistent with the rest of the code making clear
fields are pointers.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Uri Lublin <uril@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2016-01-07 16:46:19 +00:00
Victor Toso
397eb47816 Remove headers that are included in spice_common.h
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-01-07 12:46:42 +01:00
Pavel Grunt
c3f2d217af m4: Add macro for --with-sasl
It is not used by spice-common, but both server and client can use it.
Compared to current checks in spice-gtk and spice server this macro only
supports libsasl2.

Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2015-12-18 13:57:58 +01:00
Lukas Venhoda
a78da942a7 Remove trailing whitespace 2015-12-18 11:41:15 +01:00
Lukas Venhoda
1118712c59 ppc: Fix alpha state checking on BE machines
The surface before conversion can be either LE or BE on a BE machine.
Check against both BE and LE color order on BE machine.
2015-12-17 16:03:22 +01:00
Lukas Venhoda
2493c60ff7 ppc: Fix colors on ppc when using jpeg
Fixes color order on PowerPC when using jpeg compression.
2015-12-17 16:03:20 +01:00
Lukas Venhoda
98f9097c49 ppc: Fix colors on ppc when using LZ4
Fixes color order on PowerPC when using LZ4 image compression.
2015-12-17 16:03:20 +01:00
Lukas Venhoda
d7719d3e60 ppc: Fix colors on ppc when using LZ
Fixes color order on PowerPC when using LZ image compression.
2015-12-17 16:03:20 +01:00
Lukas Venhoda
bdc9951049 ppc: Fix colors on ppc when using QUIC
Fixes color order on PowerPC when using QUIC image compression.
2015-12-17 16:03:19 +01:00
Lukas Venhoda
76a0c2fae8 ppc: Add support for bigendian color byte order
On LE machine, color order when creating surface will always be A/XRGB.
On BE machines the color order will sometimes be ARGB and sometimes BGRA/X.

This is because we actually create the surface two times on BE machines.
Once with BE order, and then again with LE order. Copying data inbetween
theese two surfaces will byteswap the colors automatically.

This change introduces cases for BGRA/X color byte orders on BE machines.
2015-12-17 16:03:19 +01:00
Lukas Venhoda
fc1f511bb8 pixman_utils: Use PIXMAN_LE_ constants in spice_bitmap_try_as_pixman()
After the previous commit, spice_bitmap_try_as_pixman() can be
simplified as its #ifdef WORDS_BIGENDIAN exactly match what the
PIXMAN_LE_ constants do.
2015-12-17 16:03:19 +01:00
Lukas Venhoda
2ee5cb522e pixman_utils: Add macros for color byte ordering
When using image compression on PowerPC architecture, colors are in
wrong order ARGB -> BGRA.

This commit introduces macros, that will change the color order
according to machine endianness.

Theese macros are similar to QEMU macros in qemu-pixman.h
2015-12-17 16:03:19 +01:00
Christophe Fergeau
02c82b468c test: Use _LDADD rather than _LDFLAGS
This allows libtool/automake to correctly add a dependency from
libspice-common.la to test_marshallers. With _LDFLAGS, the binary won't
automatically get rebuilt/relinked when the lib changes.
2015-12-16 15:03:53 +01:00
Christophe Fergeau
d13fdd7fa9 m4: Fix SPICE_WARNING on el6
autogen.sh fails on el6 unless the second argument to
AC_DEFUN([SPICE_WARNING]) is enclosed in []
2015-12-14 15:30:41 +01:00
Christophe Fergeau
47122befcd ssl-verify: Don't leak GInetAddress
GInetAddress is a GObject, so we must unref anything we create with
g_inet_address_new_*
2015-11-27 17:50:02 +01:00
Christophe Fergeau
9057e0aef3 ssl-verify: Handle NULL return from g_inet_address_new_from_string()
It will return NULL if the string we pass it cannot be parsed.
2015-11-27 17:50:02 +01:00
Marc-André Lureau
f8db887eb0 Use new libcacard.h if possible
libcacard.h requires 2.5.1. Keep compatibility for older versions until
the transition in distros to the standalone version is done.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
[ Christophe: add < 2.5.1 fallback ]
Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
2015-11-25 15:16:35 +01:00
Marc-André Lureau
56a0cf2dad Fix make distcheck
Fix make distcheck both with standalone spice-common and with spice
server.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
2015-11-25 14:05:42 +01:00
Lukas Venhoda
401801b5ba canvas_base: Remove redundant switch case block 2015-11-24 08:29:28 +01:00
Francois Gouget
f471022453 build-sys: Add SPICE_CHECK_GSTREAMER_ELEMENTS()
This makes it possible to warn the developer that the GStreamer elements
needed at runtime are missing and give him a hint on how to fix the
issue.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
2015-11-16 16:31:06 +01:00
Francois Gouget
437b817f49 build-sys: Add SPICE_CHECK_GSTREAMER()
This simplifies checking for GStreamer modules by setting all the
variables we normally need.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
2015-11-04 10:34:19 +01:00
Francois Gouget
899a7c75e3 build-sys: Add the SPICE_WARNING() and SPICE_PRINT_MESSAGES m4 macros
A call to SPICE_WARNING() anywhere in the configure file results in the
warning being printed at the end of the configure run where it will be
be visible. This makes it possible to keep the SPICE_WARNING() calls
together with the related feature checks instead of having to put a
separate AC_MSG_WARN() call near the end.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
2015-11-04 10:34:19 +01:00
Christophe Fergeau
304a16fdad build-sys: Add missing # to comment
SPICE_CHECK_SMARTCARD documentation ends with a '-------' comment, but
the # to start the comment is missing, causing a warning message when
running configure.
2015-11-02 12:30:09 +01:00
Christophe Fergeau
d8c3568a31 build-sys: Rename SUPPORT_GL to HAVE_GL
The other conditionals are using the HAVE_ prefix, using HAVE_GL rather
than SUPPORT_GL improves consistency.
2015-10-23 14:05:39 +02:00
Christophe Fergeau
f77805773f build-sys: Set automake conditional in SPICE_CHECK_SMARTCARD
spice-server will use this.
2015-10-23 14:05:39 +02:00
Christophe Fergeau
986ad88c28 build-sys: Fix error in SPICE_CHECK_LZ4 description
This macro does not define a SUPPORT_LZ4 automake conditional.
2015-10-23 14:05:23 +02:00
Christophe Fergeau
04ed3b8cbe build-sys: Add gio-2.0 to SPICE_CHECK_GLIB2
GInetAddress is defined in gio, not glib. Not checking for gio-2.0 in
SPICE_CHECK_GLIB2 means gio won't be in GLIB2_LIBS, which causes link
errors when trying to build spice-server.
2015-10-23 14:05:23 +02:00
Lukas Venhoda
9749e7ed14 ssl-verify: Changed IPv4 hostname to IPv6
Change inet_aton function to glib functions.

inet_aton only supported IPv4 addresses, and wasn't available on windows
machines. GInetAddress functions support IPv6 natively, and requires less
boilerplate code then IPv6 gettaddrinfo().
2015-10-23 11:07:58 +02:00
Lukas Venhoda
9b74e47ed3 m4: Require glib version >= 2.22
This is required by the GInetAddress functions.
2015-10-23 11:07:58 +02:00
Lukas Venhoda
fb6904f528 ssl-verify: Only check addr length when using IP addr
Only check for address length, when connecting through IP address.
It is not used, when connecting through DNS hostname.
2015-10-23 11:07:45 +02:00
Christophe Fergeau
f7ec855af3 build-sys: Rework SPICE_CHECK_* m4 macros
These macros were automatically appending the needed CFLAGS/LIBS to
variables passed as arguments. This is how spice-common uses them, but
now how spice-gtk/spice want to use them, and is making the macros more
complicated than they could (in particular this makes them use
AS_VAR_APPEND).
This  is also not flexible enough as spice-gtk uses libcacard libraries,
while spice-common does not need them. If SPICE_CHECK_SMARTCARD
unconditionnally libcacard libraries to the variable spice-common passes
it as an argument, we'll end up linking with an unneeded library.

This commit removes this automatic appending from the SPICE_CHECK_*
macros and moves it to spice-common as it's the only one which needs it.
2015-10-13 11:26:01 +02:00
Christophe Fergeau
26a533d6eb build-sys: Use ${PKG_CONFIG} rather than pkg-config
In mingw builds, this will be set to mingw-pkg-config rather than the
host system one. This is fixing a build failure on mingw when
spice-protocol is only installed in the mingw prefix and not
system-wide.
2015-10-07 18:01:17 +02:00
Christophe Fergeau
523875d8c5 Add marshaller test case
This allows to test the spice_marshaller_linearize() fix which was sent
recently.
2015-09-15 17:48:59 +02:00
Javier Celaya
7b146745ee Fix linearization of several marshallers with one item
The linearization optimization that avoids copying only one item must
check that there are no further marshallers in the chain.

Just to be clear, we are trying to marshall a message like this:

message {
    uint32 data_size;
    uint64 *data[data_size] @marshall;
} SomeData;

Where the data field points to an array in dynamic memory. Marshalling
and demarshalling functions look good. The marshalling function creates
a submarshaller for the data field and links it to the root marshaller.
But when it comes to sending the data through the wire, only the
data_size field gets sent. We have observed that, in
spice_marshaller_linearize, execution enters into the optimization that
avoids copying the data when the root marshaller only has one item, but
it ignores the following marshallers in the list. Checking if there are
more marshallers fixes the problem.
2015-09-15 17:38:12 +02:00
Frediano Ziglio
449c5da90f common: Fix typo in comment
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-08-14 19:19:24 +01:00
Christophe Fergeau
dd63a3b656 build-sys: Remove code generation files from EXTRA_DIST
This breaks make distcheck otherwise since commit
7665dcf1 removed these files.
2015-08-14 15:54:14 +02:00
Frediano Ziglio
7665dcf1bb Remove files moved to spice-protocol
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-08-11 10:26:06 +02:00
Christophe Fergeau
f88a7b7bec Use installed spice-protocol for code generation
Now that spice-protocol ships the needed .proto files as well as the
corresponding python scripts, spice-common can use these in order to
generate the C code for the SPICE (de)marshallers.
2015-08-11 10:26:06 +02:00
Christophe Fergeau
c48b0a0672 Remove spice-protocol submodule
spice-protocol is a separate project which is having releases, so there
is no need to have a private spice-protocol copy in each spice-common
user, especially as after installation, the system-wide spice-protocol
copy will be used instead of the private one the module was built
against.
2015-08-11 10:26:06 +02:00
Uri Lublin
53f7f543f9 codegen: ptypes.py: keep attribute names in sets
This patch changes the type of 'valid_attributes' and
'attributes_with_arguments'.
Both of them are list of different strings and are kept in sets.

This was the intention of the original code, but this patch
use a specific set([ strings ]) format, instead of { strings }.

This fixes the build for me on RHEL-6 (python-2.6.6).
Build error is:

File "/home/ulublin/git/spice/spice-common/python_modules/ptypes.py",
line 67
      'end',
           ^
SyntaxError: invalid syntax
2015-08-04 20:10:22 +03:00
Christophe Fergeau
f2ed9a35a2 Update spice-protocol submodule
Christophe Fergeau (3):
      Prepare for spice-protocol 0.12.8 release
      Post-release version bump
      Rename SpiceImageCompress constants

Sandy Stutsman (1):
      Add QXL_ESCAPE_MONITOR_CONFIG enum
2015-07-29 17:30:09 +02:00
Frediano Ziglio
a1d1d396cd codegen: Allow to specify C type for index variable
This is to prepare to generate the wireshark dissector which uses
glib types instead of the newer C ones (for compatibility with some
compilers).

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-07-23 11:22:11 +02:00
Frediano Ziglio
f717273002 codegen: Check we don't pop too many indexes 2015-07-23 11:22:11 +02:00
Frediano Ziglio
f0f578abee codegen: Remove old ptr32 attribute
This attribute is not used in code.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-07-23 11:22:11 +02:00
Frediano Ziglio
eff8b1a0e4 codegen: Do some checks on attributes
Verify that the attribute is known. This could help for instance to
avoid some future typo mistakes.
We also now have a list of attributes that we can comment for
documentation purpose.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-07-23 11:20:19 +02:00
Frediano Ziglio
179928fceb codegen: Reuse code to fix attribute from prototype file
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-07-23 11:11:47 +02:00
Frediano Ziglio
365866c4c9 codegen: Remove duplicate variable initialization
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-07-23 11:11:44 +02:00