summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2015-10-07build-sys: Use ${PKG_CONFIG} rather than pkg-configHEADmasterChristophe Fergeau1-1/+1
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-09-15Add marshaller test caseChristophe Fergeau5-0/+111
This allows to test the spice_marshaller_linearize() fix which was sent recently.
2015-09-15Fix linearization of several marshallers with one itemJavier Celaya1-1/+1
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-08-14common: Fix typo in commentFrediano Ziglio1-1/+1
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-08-14build-sys: Remove code generation files from EXTRA_DISTChristophe Fergeau1-8/+0
This breaks make distcheck otherwise since commit 7665dcf1 removed these files.
2015-08-11Remove files moved to spice-protocolFrediano Ziglio13-5987/+1
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-08-11Use installed spice-protocol for code generationChristophe Fergeau3-30/+27
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-11Remove spice-protocol submoduleChristophe Fergeau4-7/+1
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-04codegen: ptypes.py: keep attribute names in setsUri Lublin1-4/+4
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-07-29Update spice-protocol submoduleChristophe Fergeau1-0/+0
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-23codegen: Allow to specify C type for index variableFrediano Ziglio1-1/+3
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-23codegen: Check we don't pop too many indexesFrediano Ziglio1-0/+1
2015-07-23codegen: Remove old ptr32 attributeFrediano Ziglio1-4/+0
This attribute is not used in code. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-07-23codegen: Do some checks on attributesFrediano Ziglio1-0/+72
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-23codegen: Reuse code to fix attribute from prototype fileFrediano Ziglio1-16/+16
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-07-23codegen: Remove duplicate variable initializationFrediano Ziglio1-1/+0
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-07-23codegen: Optimize code indentation and avoid a loopFrediano Ziglio1-2/+1
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-07-23codegen: Fix typo in variable nameFrediano Ziglio1-1/+1
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-07-23codegen: Simplify if/else blocksFrediano Ziglio1-18/+11
Blocks were mainly the same, this reduces the amount of code. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-07-23codegen: Import six module before first useFrediano Ziglio1-1/+2
The module is used in the initial try/except so make sure it is already imported. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-07-23codegen: Fix enums.h generation with python3Christophe Fergeau1-2/+2
Trying to generate enums.h with python3 results in Traceback (most recent call last): File "./spice_codegen.py", line 217, in <module> write_enums(writer, options.generate_dissector) File "./spice_codegen.py", line 99, in write_enums write_channel_enums(writer, c, False, False) File "./spice_codegen.py", line 17, in write_channel_enums if len(messages) == 0: TypeError: object of type 'filter' has no len() filter() returns an enumerator object in python3 while it used to return a list in python2. Using list(filter()) instead fixes that error. I've checked that the generated enums.h is identical with python2 and python3.
2015-07-20proto: Remove space before tabChristophe Fergeau2-3/+3
There are 3 lines in spice.proto/spice1.proto which start with spaces and then contain a tab. This commit removes the spaces and only keep the tab.
2015-07-02m4: Add compat AS_VAR_APPEND for older autoconfChristophe Fergeau2-4/+5
This causes failures on EL6 otherwise as autoconf is too old there.
2015-07-02ppc: Fix quic magic endianessLukas Venhoda1-1/+2
Runtime conversion from a string to uint32 is storing the magic with the same endianness on both LE and BE machines. This requires aditional byte swap when sending magic between LE/BE machines. Changing quic magic to a constant will ensure, that it will be always stored in native endianness, and the second byte swap won't be needed.
2015-07-02ppc: Fix lz magic endianessLukas Venhoda2-4/+3
Commit d39dfbfe changes lz magic to be always treated as LE when encoded. Runtime conversion from a string to uint32 is storing the magic with the same endianness on both LE and BE machines. This requires aditional byte swap when sending magic between LE/BE machines. Changing lz magic to a constant will ensure, that it will be always stored in native endianness, and the second byte swap won't be needed. This commit reverts d39dfbfe changes in lz.c while keeping the rest. They will be needed in future commit for quic.c
2015-07-02ppc: Fix quic decode endianessLukas Venhoda1-3/+5
Converts all decoded words in quic from little endian to local machine endianness.
2015-06-22Update spice-protocolChristophe Fergeau1-0/+0
Christophe Fergeau (1): Post-release version bump Javier Celaya (2): Update enums.h for preferred compression message Add a preferred compression capability
2015-06-22Proto: Add preferred compression message and constants.Javier Celaya3-0/+20
When accessing a virtual desktop from different devices, some may have different image compression requirements, e.g. slow devices may prefer the faster LZ4 over GLZ. This message instructs the server to switch the image compression algorithm. This patch also promotes the SPICE_IMAGE_COMPRESS_* constants so that they are available from both the server and the client.
2015-06-17m4: Add macro for --enable-lz4Christophe Fergeau1-0/+24
It's not directly used by spice-common, but this way spice-gtk and spice-server can share the same implementation.
2015-04-24Update spice-protocol submoduleVictor Toso1-0/+0
This includes volume synchronization protocol;
2015-04-14codegen: Use six.PY3 rather than six.PY2Christophe Fergeau2-6/+6
Older versions of python-six (at least 1.3.0) defined six.PY3 but not six.PY2. six.PY2 is only used twice in straightforward tests so it's easy to use six.PY3 instead.
2015-04-13configure.ac: Check for needed python modules for git buildsChristophe Fergeau4-1/+71
After the patch adding support for python 3 to the code generator, python-six is required when building from git. Since I got 2 different reports of SPICE build failures right after introducing it, it's probably better to check for the needed python modules from configure, and exit with an error if they are missing. This commit adds a --enable-python-checks configure flag for that though, since we only want to do that when building from git. It assumes that people running from git will be running autogen.sh, while people building from tarballs will run configure.
2015-04-10ppc: build-sys: Add big-endian supportErlon Cruz1-0/+1
A few files (the generated marshalling code and pixman-related utils) make use of WORDS_BIGENDIAN in order to do the right thing depending on endianness. configure.ac must call AC_C_BIGENDIAN for it to be defined. Signed-off-by: Erlon R. Cruz <erlon.cruz@br.flextronics.com> Signed-off-by: Rafael F. Santos <fonsecasantos.rafael@gmail.com> Signed-off-by: Fabiano Fidêncio <Fabiano.Fidêncio@fit-tecnologia.org.br>
2015-04-10ppc: Fix lz magic endiannessErlon Cruz3-1/+16
Signed-off-by: Erlon R. Cruz <erlon.cruz@br.flextronics.com> Signed-off-by: Rafael F. Santos <fonsecasantos.rafael@gmail.com> Signed-off-by: Fabiano Fidêncio <Fabiano.Fidêncio@fit-tecnologia.org.br>
2015-04-01Make spice_codegen.py work on both Python 2 and 3Alexander Wauck6-69/+78
This is a new version of my previous patch that does not include six.py. It's still kind of big, but at least it's all spice-common changes now. There are also a few other fixes that Christophe brought to my attention. Note that six now needs to be installed on the system (python-six on Fedora and Debian, six on PyPI). This *should* be enough to make spice_codegen.py work on both Python 2 and Python 3. The major changes are as follows: * cStringIO.StringIO -> io.StringIO * str vs. unicode updates (io.StringIO doesn't like str) * integer division * foo.has_key(bar) -> bar in foo * import internal_thing -> from . import internal_thing * removed from __future__ import with_statement (might break Python 2.5?) * changed some lambdas to list comprehensions (done by 2to3) * cast some_dict.keys() to list where needed (e.g. for sorting) * use normal type names with isinstance instead of types.WhateverType Signed-off-by: Alexander Wauck <awauck@codeweavers.com>
2015-03-26ssl_verify: Move wincrypt.h related #ifdef closer to the includeChristophe Fergeau1-4/+4
Both wincrypt.h and openssl try to define X509_NAME. The wincrypt.h one is not useful for us, so we currently #undef it if this was set. However, it's done very late, right before including x509v3.h which defines the X509_NAME type. Any header included in between may try to #include x509v3.h so it's better to undefine X509_NAME right after including wincrypt.h.
2015-03-26Get rid of SW_CANVAS_IMAGE_CACHEChristophe Fergeau6-42/+14
Every time it's used, it's in constructs similar to: #ifdef SW_CANVAS_CACHE , SpiceImageCache *bits_cache , SpicePaletteCache *palette_cache #elif defined(SW_CANVAS_IMAGE_CACHE) , SpiceImageCache *bits_cache #endif This can be rewritten as: , SpiceImageCache *bits_cache #ifdef SW_CANVAS_CACHE , SpicePaletteCache *palette_cache #endif allowing to get rid of SW_CANVAS_IMAGE_CACHE.
2015-03-26Remove another redundant (SW_CANVAS_CACHE) || (SW_CANVAS_IMAGE_CACHE) #ifdefChristophe Fergeau1-2/+0
2015-02-25Fix typo in pixman_image_get_stride() functionFabiano Fidêncio1-1/+1
pixman_image_surface_get_stride -> pixman_image_get_stride
2015-02-03LZ4: Do not include arpa/inet.h in Windows buildsJavier Celaya1-0/+2
2015-02-03LZ4: Add support for 24bit pixman surfacesJavier Celaya2-0/+11
2015-02-03LZ4: Fix the row alignment when it is not on a 32bit boundaryJavier Celaya1-2/+20
Fix the row alignment for 16/24 bpp images when it is not in a 32bit boundary. This is needed for 16bpp images when the width is an odd number, and for the future support of 24bpp images.
2015-02-03LZ4: Decode the image format from the streamJavier Celaya1-1/+19
2015-02-03LZ4: Adjust reading the top_down flagJavier Celaya1-4/+4
Adjust the way the top_down flag is read to the corresponding change in the wire protocol.
2015-02-03LZ4: Fix output buffer sizeJavier Celaya1-2/+4
2015-01-23Remove redundant #if defined(SW_CANVAS_CACHE) || defined(SW_CANVAS_IMAGE_CACHE)Christophe Fergeau1-37/+1
SW_CANVAS_CACHE is always defined when building spice-gtk, SW_CANVAS_IMAGE_CACHE is always defined when building spice-server, and they are the only 2 users of spice-common. Moreover, build when none of these is defined is broken.
2015-01-23Remove unused 'invers' arg from canvas_get_*Christophe Fergeau1-67/+11
All canvas_get_{quic,jpeg,lz4,jpeg_alpha,lz} methods have an 'invers' argument, but are always called with that argument being 0, so we can drop it from the argument list, and remove the code triggerring when it's true.
2015-01-06common: fix build with mingwVictor Toso1-1/+1
2014-12-09build-sys: Move pixman check to m4 macroChristophe Fergeau3-4/+13
2014-12-09build-sys: Move opengl check to m4 macroChristophe Fergeau3-21/+32