summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* proto: Use proper type for preferred_compression fieldChristophe Fergeau2015-08-071-1/+1
| | | | | No need to use an uint8 typed member, we can directly use the appropriate enum8 type here, which makes everything more explicit.
* proto: Rename image_compress to image_compressionChristophe Fergeau2015-08-071-1/+1
| | | | | | | 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.
* build-sys: Install code generation data/scriptsChristophe Fergeau2015-08-072-9/+10
| | | | | | | spice-common generate code from these python scripts and the installed SPICE .proto. This commit installs them during make install, and adds a codegendir variable to the pkgconfig file so that spice-common can locate the scripts.
* build-sys: Add --enable-code-generatorChristophe Fergeau2015-08-073-1/+41
| | | | | | | | | This flag is only used for git builds, and can usually safely be disabled. When it's enabled, configure.ac will check that python-six and pyparsing are available, and will use these together with the codegen python scripts in order to automatically regenerate enums.h when the .proto files change.
* build-sys: Make sure new files are dist'edChristophe Fergeau2015-08-072-1/+11
| | | | | | The just added .proto files and python code generation code need to be added to EXTRA_DIST in order to be distributed in tarballs, and we need to recurse in the new python_modules directory.
* Merge protocol code generation bits from spice-commonChristophe Fergeau2015-08-0710-0/+5983
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The history for spice*.proto, spice_codegen.py and python_modules/ was extracted from spice-common using git filter-branch: git filter-branch \ --prune-empty \ --index-filter ' git ls-tree -z -r --name-only --full-tree $GIT_COMMIT \ | grep -z -v "^python_modules/" \ | grep -z -v "^spice.proto" \ | grep -z -v "^spice1.proto" \ | grep -z -v "^spice_codegen.py" \ | xargs -0 -r git rm -f --cached -r ' \ -- \ --all git filter-branch --force \ --prune-empty \ --index-filter ' git rm -f spice-protocol --cached --ignore-unmatch ' \ -- \ --all
| * codegen: ptypes.py: keep attribute names in setsUri Lublin2015-08-041-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
| * codegen: Allow to specify C type for index variableFrediano Ziglio2015-07-231-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>
| * codegen: Check we don't pop too many indexesFrediano Ziglio2015-07-231-0/+1
| |
| * codegen: Remove old ptr32 attributeFrediano Ziglio2015-07-231-4/+0
| | | | | | | | | | | | This attribute is not used in code. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
| * codegen: Do some checks on attributesFrediano Ziglio2015-07-231-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>
| * codegen: Reuse code to fix attribute from prototype fileFrediano Ziglio2015-07-231-16/+16
| | | | | | | | Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
| * codegen: Remove duplicate variable initializationFrediano Ziglio2015-07-231-1/+0
| | | | | | | | Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
| * codegen: Optimize code indentation and avoid a loopFrediano Ziglio2015-07-231-2/+1
| | | | | | | | Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
| * codegen: Fix typo in variable nameFrediano Ziglio2015-07-231-1/+1
| | | | | | | | Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
| * codegen: Simplify if/else blocksFrediano Ziglio2015-07-231-18/+11
| | | | | | | | | | | | Blocks were mainly the same, this reduces the amount of code. Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
| * codegen: Import six module before first useFrediano Ziglio2015-07-231-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>
| * codegen: Fix enums.h generation with python3Christophe Fergeau2015-07-231-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.
| * proto: Remove space before tabChristophe Fergeau2015-07-202-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.
| * Proto: Add preferred compression message and constants.Javier Celaya2015-06-221-0/+15
| | | | | | | | | | | | | | | | | | 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.
| * codegen: Use six.PY3 rather than six.PY2Christophe Fergeau2015-04-142-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.
| * Make spice_codegen.py work on both Python 2 and 3Alexander Wauck2015-04-016-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>
| * Add LZ4 image compression support.Javier Celaya2014-12-021-0/+3
| | | | | | | | | | | | | | - Add a new LZ4 image type to spice.proto. - Add canvas_get_lz4() to common_canvas_base, to get a pixmap from an lz4 image. - Add an enable-lz4 switch to the configure script, disabled by default.
| * python: Fix -Wsign-compareFabiano Fidêncio2014-09-181-3/+3
| | | | | | | | | | | | | | The return of the get_array_size() is used as a limit in a loop, being compared with an unsigned index (indexes are always unsigned). To avoid the -Wsign-compare warning, let's cast the return of the get_array_size() to unsigned and make GCC happier.
| * python: Fix -Wunused-parameterFabiano Fidêncio2014-09-182-7/+7
| | | | | | | | | | | | | | | | Although the most part of the parameters marked as unused are actually being used for a few functions, a bunch of warnings can be seen when the code is compiled with "-Wall -Wextra". As adding the unused attribute means that the variable/parameter is meant to be *possibly* unused, we're safe adding it in the generated code, even for used variables/parameters.
| * demarshal: prefix variable name with parent namesMarc-André Lureau2014-05-151-17/+30
| | | | | | | | | | | | Avoid naming clash if parent structures have the same name https://bugzilla.redhat.com/show_bug.cgi?id=1021995
| * marshaller: Use #include <> for headers in $srcdir/commonChristophe Fergeau2014-04-162-3/+3
| | | | | | | | | | | | | | Since the (de)marshallers are now generated in $builddir and not in $srcdir, when these generated files include a file located in $srcdir/common, the compiler will find them thanks to a -I directive, so it makes more sense to use <> rather than "" when including them.
| * Use #include "common/..." in (de)marshallersChristophe Fergeau2014-04-162-3/+3
| | | | | | | | | | | | | | | | Now that they are created in $builddir, their includes will need to refer to files in $srcdir, which can be different. It's cleaner to add -I $(top_srcdir)/spice-common/ to modules using spice-common rather than having -I $(top_srcdir)/spice-common/common which would could create header collisions.
| * spice.proto: add webdav channelMarc-André Lureau2014-03-191-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This channel provides a webdav server (rfc4918). This allows various guest or remote system that support webdav to access a folder shared by the client (some agent can be used to proxy the requests on a local port for example). The webdav server may also be accessed by an hypervisor as a remote filesystem interface, which can then be accessed by the guest via other means (fs/fat emulation, mtp device, etc) Due to the usage of a single channel stream and the need for concurrent requests, webdav clients streams are multiplexed. Each client stream is framed within 64k max messages (in little-endian) int64 client_id uint16 size char data[size] A new client_id indicates a new connection. A new communication stream with the webdav server should be started. A client stream message of size 0 indicates a disconnection of client_id. This multiplexed communication happens over the channel "data" message. Only when the port is opened may the communication be started. A closed port event should close all currently known multiplexed connections. Why WebDAV? webdav is supported natively by various OS for a long time (circa Windows XP). It has several open-source implementations and a variety of tools exist. A webdav implementation can be tested and used without a Spice server or any virtualization (this also permit sharing the implementation with other projects in the future, such as GNOME). It is an IETF open standard and thus thoroughly specified. The basic requirements for an efficient remote filesystem are provided by the standard (pipelining, concurrency, caching, copy/move, partial io, compression, locking ...) While other features are easily possible via extensions to the protocol (common ones are executable attributes, or searching for example). Given the requirements, and the popularity of http/webdav, I believe it is the best candidate for Spice remote filesystem support. Other alternatives (adhoc, p9, smb2, sftp) have been studied and discarded so far since they do not match in term of features or requirements.
| * Add support for the Opus codec.Jeremy White2014-01-022-0/+2
| | | | | | | | Signed-off-by: Jeremy White <jwhite@codeweavers.com>
| * Be explicit about spice-common licenseJonathon Jongsma2013-10-231-2/+21
| | | | | | | | | | | | | | Use same license as spice-gtk and spice modules (LGPL 2.1) since those licenses applied to the spice-common submodule in the past. This makes it more clear that if you use spice-common separately, the license is still LGPL. Also mention license and copyright in generated files.
| * codegen: Add a --generate-wireshark-dissector optionJonathon Jongsma2013-10-232-32/+82
| | | | | | | | | | | | | | | | | | The wireshark protocol dissector is a bit out-of-date. Several new channel types and enums have been added. It would be nice if these values (and the translation between the value and the name) could be automatically generated so that updating the dissector was a slightly less manual process. This patch adds a commandline switch which generates both the enums and value-name lists in the format that wireshark expects.
| * proto: add fake last message in base channelMarc-André Lureau2013-09-121-0/+2
| | | | | | | | | | Make it explicit that 100 is the last value of the base channel messages. This allows clients to use the generated enum value too.
| * proto: comment future surface flags usageMarc-André Lureau2013-09-121-0/+2
| |
| * add SPICE_MSG_PLAYBACK_LATENCYYonit Halperin2013-04-221-0/+4
| | | | | | | | | | | | | | SPICE_MSG_PLAYBACK_LATENCY is intended for adjusting the latency of the audio playback. It is used for synchronizing the audio and video playback. The corresponding capability is SPICE_PLAYBACK_CAP_LATENCY.
| * add stream report messagesYonit Halperin2013-04-221-0/+18
| | | | | | | | | | | | | | | | | | If the server & client support SPICE_DISPLAY_CAP_STREAM_REPORT, the server first sends SPICE_MSG_DISPLAY_STREAM_ACTIVATE_REPORT. Then, the client periodically sends SPICE_MSGC_DISPLAY_STREAM_REPORT messages that supply the server details about the current quality of the video streaming on the client side. The server analyses the report and adjust the stream parameters accordingly.
| * Add a "port" channelMarc-André Lureau2012-12-051-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A Spice port channel carry arbitrary data between the Spice client and the Spice server. It may be used to provide additional services on top of a Spice connection. For example, a channel can be associated with the qemu monitor for the client to interact with it, just like any qemu chardev. Or it may be used with various protocols, such as the Spice Controller. A port kind is identified simply by its fqdn, such as org.qemu.monitor, org.spice.spicy.test or org.ovirt.controller... The channel is based on Spicevmc which simply tunnels data between client and server. A few messages have been added: SPICE_MSG_PORT_INIT: Describes the port state and fqdn name, should be sent only once when the client connects. SPICE_MSG_PORT_EVENT: Server port event. SPICE_PORT_EVENT_OPENED and SPICE_PORT_EVENT_CLOSED are typical values when the chardev is opened or closed. SPICE_MSGC_PORT_EVENT: Client port event.
| * inputs: add a INPUTS_KEY_SCANCODE messageMarc-André Lureau2012-08-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | Add a new arbitrary keyboard scancodes message. For now, it will be used to avoid unwanted key repeatition when there is jitter in the network and too much time between DOWN and UP messages, instead the client will send the press & release scancode in a sequence. See also: https://bugzilla.redhat.com/show_bug.cgi?id=812347
| * support seamless migrationYonit Halperin2012-08-272-6/+28
| | | | | | | | | | see spice-protocol for more details commit 3838ad140a046c4ddf42fef58c9727ecfdc09f9f
| * add SPICE_MSG_MAIN_AGENT_CONNECTED_TOKENSYonit Halperin2012-08-271-0/+4
| | | | | | | | | | The msg is used for setting the number of allocated client tokens when we notify the client that the agent is attached.
| * Add support for A8 images to the LZ routinesSøren Sandmann Pedersen2012-08-241-1/+55
| | | | | | | | | | This format is needed to add Render support to the X driver, so we need the ability to compress and decompress it.
| * support multiple monitors in single display channelAlon Levy2012-07-121-0/+16
| | | | | | | | | | | | See spice-protocol commit for details: da908f89b581fd4725da997fdaea209f8e6548f6 support multiple monitors on a single display channel
| * smartcard: build fixes for spice serverAlon Levy2012-06-141-3/+3
| | | | | | | | | | | | | | Define different enums that have a SPICE_ prefix to not conflict with same value enums from libcacard/vsccard_common.h, and continue to use the same SPICE_MSG_SMARTCARD_DATA and SPICE_MSGC_SMARTCARD_DATA enum that is used by the server and clients (spice-gtk, spicec) alike.
| * python_modules/ptypes.py/EnumBaseType.c_enumname: add missing return to fix ↵Alon Levy2012-06-141-1/+1
| | | | | | | | | | | | | | | | | | | | broken enums generation Fixes the resulting enums.h from the invocation of: ./spice_codegen.py --generate-enums spice.proto spice-protocol/spice/enums.h Right now any enum will contain None as the enum members, with this fix it will contain the real enum members, i.e. SPICE_FOO.
| * video streaming: add support for frames of different sizesYonit Halperin2012-05-022-5/+22
| | | | | | | | | | | | | | | | | | rhbz #813826, #815426 Add SPICE_MSG_DISPLAY_STREAM_DATA_SIZED, for stream_data message that also contains the size and destination box of the data. The server can send such messages only to clients with SPICE_DISPLAY_CAP_SIZED_STREAM.
| * demarshall: add missing parens in BE read_xxx functionsChristophe Fergeau2012-04-061-1/+1
| | | | | | | | The missing parens causes build to fail on big-endian machines
| * build-sys: make it a seperately buildable spice-common libraryMarc-André Lureau2012-03-221-1/+12
| | | | | | | | | | | | | | - autotoolize - fix headers inclusion - generate gitignores - workaround serverSMARTCARD support with dirty hack...
| * spice.proto: fix demarshaller crash with name messageMarc-André Lureau2012-03-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | It turned out the demarshaller wasn't allocating enough space to memcpy the name. In order to take into account the size of a variable array, it needs to be marked with the @end tag so that the "extra_size" is added to the allocated memory. It would be nice if the demarshaller would somehow fail if this wasn't set explicitly, or do the right thing by default. @end the name so that demarshaller
| * codegen: ifdef/endif function declaration tooMarc-André Lureau2012-03-211-0/+2
| | | | | | | | | | | | Compile out part that we are not supporting. In the future, we might want to declare a fake type and an empty function to keep API compatibility
| * codegen: include headers locallyMarc-André Lureau2012-03-212-2/+3
| |