Compare commits

..

429 Commits

Author SHA1 Message Date
Michael Tokarev
20e56ec07c set maintainer to the QEMU team. Closes: #911429 2020-07-06 12:53:49 +03:00
Michael Tokarev
8e06f496e7 Update upstream source from tag 'upstream/0.14.2'
Update to upstream version '0.14.2'
with Debian dir 63c847595a
2020-07-06 12:51:43 +03:00
Michael Tokarev
3a8130579a New upstream version 0.14.2 2020-07-06 12:51:43 +03:00
Michael Tokarev
40d03fb499 d/watch: also allow .gz and .xz extensions for the upstream archive, not only .bz2 2020-07-06 12:51:37 +03:00
Laurent Bigonville
67473e0fc0 Import Debian changes 0.14.1-1
spice-protocol (0.14.1-1) unstable; urgency=medium

  * Team upload.
  * New upstream release
  * debian/gbp.conf: Enable pristine-tar
  * Bump Standards-Version to 4.5.0 (no further changes)
  * Bump debhelper compatibility to 12
2020-07-06 12:44:02 +03:00
Michael Tokarev
689053b07c Import Upstream version 0.14.1 2020-07-06 12:43:28 +03:00
Laurent Bigonville
139b2c980c Import Debian changes 0.14.0-1
spice-protocol (0.14.0-1) unstable; urgency=medium

  * Team upload.
  [ Ondřej Nový ]
  * d/copyright: Change Format URL to correct one
  * d/changelog: Remove trailing whitespaces
  * d/control: Remove trailing whitespaces

  [ Laurent Bigonville ]
  * Enable upstream tarball signature verification
  * New upstream version 0.14.0
  * debian/docs: Dropped, the NEWS file has been renamed to CHANGELOG.md and
    is now installed by dh_installchangelogs
  * debian/control: Bump Standards-Version to 4.4.0 (no further changes)
2019-08-28 10:00:23 +03:00
Michael Tokarev
ac44f0fec5 Import Upstream version 0.14.0 2019-08-28 09:59:38 +03:00
Michael Tokarev
03d3fa09c4 import team-uploaded version 0.12.14-1 2019-08-27 19:33:16 +03:00
Victor Toso
d0cfb3648c NEWS: prepare for 0.12.14 release
Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2018-06-01 10:09:13 +02:00
Frediano Ziglio
ccda863268 vd_agent: Do not define structures without fields
According to C standard the size of a structure without fields is
not defined (see
https://stackoverflow.com/questions/21851930/size-of-empty-structure-in-c-and-c).
As we almost only use GCC currently these structures are of size 0.
This can became a problem if 2 sides talking a given protocol use
these structures.
To avoid such possible mismatch (for instance having one side C and
the other C++ which defines these structures as having 1 as size) add
an empty (0-size array) field.
Although a 0-size array is not considered also that portable we use
extensively this feature with different compilers never encountering
issues.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Uri Lublin <uril@redhat.com>
2018-05-31 17:20:54 +01:00
Frediano Ziglio
33b52556e5 Remove obsolete files used to help renaming some identifiers
These files were added in 2010.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2018-05-08 17:24:05 +01:00
Eduardo Lima (Etrunko)
440b515086 Add support for building with meson
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2018-05-08 10:38:22 +01:00
Victor Toso
545fbb8b11 streaming: define max of number of concurrent streams
This definition is lacking in client while in server it is hardcoded
to 50. Having a well defined limitation allow us to make the code
more robust and optimized.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2018-05-05 12:52:11 +01:00
Frediano Ziglio
87441524f4 stream-device: Define an enumeration to store capabilities constants
This will allow to define new capabilities.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe de Dinechin <dinechin@redhat.com>
2018-04-11 12:31:08 +01:00
Lukáš Hrázký
967ac4a24c stream-device.h: Remove the reference to the streaming port name
It is a duplicate information in a place where it is not necessary and
of little value.

Signed-off-by: Lukáš Hrázký <lhrazky@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2018-04-05 16:53:14 +02:00
Frediano Ziglio
235ac17349 stream-device: Specify how padding shoud be inside new structures
Depending on how structures are initialised in the code is
possible that implicit padding bytes are not initialised
causing possible information leaks as the entire structure
with all padding is sent through device/network.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe de Dinechin <dinechin@redhat.com>
2018-03-10 07:15:44 +00:00
Frediano Ziglio
bd279b1fc1 macros: Use Visual C++ built-ins for byte swapping if available
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-03-09 15:41:09 +00:00
Frediano Ziglio
d1dca6450c macros: Use GCC built-ins to swap bytes
GCC introduced __builtin_bswapXX intrinsics in a quite old
version.
As version 2 and 3 are no more used nowadays instead of manually
craft these functions using assembly language use the new built-ins.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-03-09 15:41:04 +00:00
Frediano Ziglio
4250216baf Allow to specify a surface will be streamed
This flag will allow the client to perform some optimisations
on output and buffering processing.
Old clients will ignore this additional flag.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2017-12-01 15:53:44 +00:00
Jonathon Jongsma
6371ecbcb1 Change STREAM_MSG_CAPABILITIES_MAX_BYTES
Clarify that this value specifies the size in bytes, not the number of
capabilities.

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-11-09 11:43:00 -06:00
Jonathon Jongsma
e2176efb0e Add definition of STREAM_MSG_CAPABILITIES_MAX
This message is specified to have a size limit of 1024, so provide this
as a #define

Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
Acked-by: Christophe de Dinechin <dinechin@redhat.com>
2017-11-01 17:06:00 +01:00
Frediano Ziglio
c05cc91972 Add support for mouse movement
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe de Dinechin <cdupontd@redhat.com>
2017-09-15 18:47:04 +01:00
Frediano Ziglio
a419692ea9 Add support for setting cursor shape from guest
This allows to better support client mouse using streaming device

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe de Dinechin <cdupontd@redhat.com>
2017-09-15 18:47:04 +01:00
Frediano Ziglio
909da449e3 Add error reports from server to guest
Acked-by: Christophe de Dinechin <cdupontd@redhat.com>
2017-09-15 18:47:04 +01:00
Frediano Ziglio
02b12e66de Add a message to control guest streaming
Allows server to tell codec and start/stop the streaming

Acked-by: Christophe de Dinechin <cdupontd@redhat.com>
2017-09-15 18:47:04 +01:00
Frediano Ziglio
a1d8ccabbf Add protocol to send streams to server
This protocol allows a guest to send a video stream to the server.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe de Dinechin <cdupontd@redhat.com>
2017-09-15 18:47:04 +01:00
Michael Shigorin
6795f4edfd macros.h: s/endianess/endianness/g
A three-time typo, obviously :)

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-09-15 18:47:01 +01:00
Michael Shigorin
ed8f30d421 macros.h: added e2k detection
Elbrus 2000 is a little-endian architecture.

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-09-15 18:46:57 +01:00
Marc-André Lureau
40544912ab build-sys: post-release bump 0.12.14 2017-07-03 13:20:29 +02:00
Marc-André Lureau
8dda82b49d NEWS: prepare for 0.12.13 release
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2017-07-03 13:14:29 +02:00
Jakub Janků
86c53ee5bf agent: Add new file-xfer statuses
Introduce new error statuses to report more info to clients:
VD_AGENT_FILE_XFER_STATUS_SESSION_LOCKED,
VD_AGENT_FILE_XFER_STATUS_VDAGENT_NOT_CONNECTED,
VD_AGENT_FILE_XFER_STATUS_DISABLED

These are only sent to clients that feature
VD_AGENT_CAP_FILE_XFER_DETAILED_ERRORS capability.
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2017-06-20 12:09:25 +02:00
Jakub Janků
8b025c4ed0 agent: Add support for reporting on free space
Agent can send VDAgentFileXferStatusMessage with result
VD_AGENT_FILE_XFER_STATUS_NOT_ENOUGH_SPACE to indicate lack of free
space. This enables more detailed error reporting, so the user knows
why the file transfer has failed.

Add VD_AGENT_CAP_FILE_XFER_DETAILED_ERRORS to ensure detailed errors
are not sent to clients that do not support it. This can be used
with more file xfer errors in the future.

Acked-by: Pavel Grunt <pgrunt@redhat.com>
2017-05-31 23:06:50 +02:00
Frediano Ziglio
068266069c Change enums.h license to MIT
This allows the header to be used in no GPL programs.
Others headers are already MIT licensed so this change do
not require additional changes to already existing
programs.

The file can be generated with

  ./spice_codegen.py -e spice.proto --license MIT enums.h

from spice-common.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2017-05-08 09:50:59 +01:00
Pavel Grunt
3f27d410b4 agent: Add capability for disabled file transfer
Server can set it to indicate that it discards file transfer messages.

Related:
https://bugzilla.redhat.com/show_bug.cgi?id=1373725

Acked-by: Victor Toso <victortoso@redhat.com>
2017-03-10 10:43:21 +01:00
Pavel Grunt
b9bfbd2f7b agent: Add macro for clearing capability
Related:
https://bugzilla.redhat.com/show_bug.cgi?id=1373725

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-03-03 13:00:36 +00:00
Frediano Ziglio
5410de6407 protocol: Add support for VP9 video codec
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2017-01-31 08:54:46 +00:00
Victor Toso
9da109a661 protocol: add preferred video codec message
Client might want to choose a preferred video codec for streaming for
different reasons which having hardware decoder support being the most
interest one.

This message allows the client to send a list of video codecs in a
order of preference.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2017-01-06 12:24:27 +00:00
Francois Gouget
b1cdb2756f macros: Add MSVC support to SPICE_GNUC_DEPRECATED
Based on the G_DEPRECATED GLib macro.
For projects that don't use GLib.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
2016-11-23 08:51:09 +01:00
Francois Gouget
0d7aa7579e macros: Use GLib's G_DEPRECATED macro if available
This gains us automatic support for whichever compilers GLib supports in
this macro when used in projects that use GLib.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
2016-11-23 08:51:09 +01:00
Frediano Ziglio
97ae0b1bb4 vd_agent: Add some comments to clipboard messages
Document what the messages are meant to do.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2016-11-11 11:52:19 +00:00
Victor Toso
82fca738a2 build-sys: post-release bump
Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
2016-11-01 14:58:57 +01:00
Victor Toso
895afe1394 enums: Move auto generated SpiceDataCompressionType
This header is auto generated from spice_codegen.py tool in
spice-common repository and thus, it changes what was included
manually.

Move SpiceDataCompressionType struct to comply with spice_codegen.py.
This header was generated with:

 ./spice_codegen.py -e spice.proto ../spice-protocol/spice/enums.h

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-24 14:42:47 +01:00
Francois Gouget
2eeb092204 protocol: Group the VDAgent clipboard message definitions
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-10-17 16:37:57 +01:00
Christophe Fergeau
91825a909b Update NEWS for 0.10.12 release 2016-07-07 15:20:13 +02:00
snir sheriber
73614b831a LZ4 compression is now available at the Spicevmc channel
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-06-13 23:03:13 +01:00
Marc-André Lureau
de68d1c074 build-sys: post-release bump
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-03-11 16:08:55 +01:00
Marc-André Lureau
1adb66c638 NEWS: update for 0.12.11 release
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-03-10 17:04:11 +01:00
Marc-André Lureau
2a6e51c7ee Remove codegen
Codegen generates code specific to spice-common submodule. It's not
meant as a generic protocol header or specification. See discussion and
commits about spice-common codegen re-import.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2016-03-10 16:57:08 +01:00
Francois Gouget
7937915d67 protocol: Add support for the VP8 and h264 video codecs
Clients that support multiple codecs must advertise the
SPICE_DISPLAY_CAP_MULTI_CODEC capability and one
SPICE_DISPLAY_CAP_CODEC_XXX per supported codec.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-03-03 17:04:44 +00:00
Frediano Ziglio
0721716bb8 macros: do not use more type safe CONTAINEROF version if not requested
This prevents incompatibility if users (like old spice-server/spice-gtk)
are not expected to have this additional restriction.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2016-03-02 12:05:55 +00:00
Marc-André Lureau
4707655962 codegen: simplify FdType
This patch is a left-over from the fd passing commit 267391c8fd as
suggested by Frediano Ziglio during review.

Signed-off-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-01-19 14:43:23 +00:00
Marc-Andre Lureau
3fc2221e96 protocol: add unix GL scanout messages
Add 2 new messages to the display channel to stream pre-rendered GL
images of the display. This is only possible when the client supports
SPICE_DISPLAY_CAP_GL_SCANOUT capability.

The first message, SPICE_MSG_DISPLAY_GL_SCANOUT_UNIX, sends a gl image
file handle via socket ancillary data, and can be imported in a GL
context with the help of eglCreateImageKHR() (as with the 2d canvas, the
SPICE_MSG_DISPLAY_MONITORS_CONFIG will give the monitors
coordinates (x/y/w/h) within the image). There can be only one scanount
per display channel.

A SPICE_MSG_DISPLAY_GL_DRAW message is sent with the coordinate of the
region within the scanount to (re)draw on the client display. For each
draw, once the client is done with the rendering, it must acknowldge it
by sending a SPICE_MSGC_DISPLAY_GL_DRAW_DONE message, in order to
release the context (it is expected to improve this in the future with a
cross-process GL fence).

The relation with the existing display channel messages is that all
other messages are unchanged: the last drawing command received must be
displayed. However the scanout display is all or nothing. Consequently,
if a 2d canvas draw is received, the display must be switched to the
drawn canvas. In other words, if the last message received is a GL draw
the display should switch to the GL display, if it's a 2d draw message
the display should be switched to the client 2d canvas.

(there will probably be a stipped-down "gl-only" channel in the future,
or support for other streaming methods, but this protocol change should
be enough for basic virgl or other gpu-accelerated support)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-01-14 11:52:41 +00:00
Marc-Andre Lureau
267391c8fd protocol: learn to describe fd passing in messages
Add a new type, "unix_fd", used to describe file descriptor sharing via
socket ancillary data (these messages are local only).

The marshaller/demarshaller can't serialize this in memory (consume_fd
implementation is empty), so it is the responsability of the marshaller
user to handle sending and receiving the handles, which are appended at
the end of the message with an extra stream byte (because some Unix
requires sending at least a byte with ancillary data).

Even if there is no fd to send (or if the fd is invalid etc), the
receiver side expects an extra byte anyway.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2016-01-14 11:46:16 +00:00
Christophe Fergeau
6b86c1a510 Use gcc builtin rather than asm for memory barriers
This should make things more portable.

On my machine, __sync_synchronize() uses mfence rather than lock; addl;
Looking at the kernel memory barriers, this should be fine:
http://lxr.free-electrons.com/source/arch/x86/um/asm/barrier.h

The kernel favours using mfence, but falls back to lock; addl; when it's
not available (32 bit non-SSE machines).

https://bugs.freedesktop.org/show_bug.cgi?id=86997
2016-01-08 15:31:38 +01:00
Frediano Ziglio
cffb8baee1 macros: make SPICE_CONTAINEROF more typesafe
Check the pointer given is the same type as member pointer.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
2015-12-04 11:15:12 +00:00
Christophe Fergeau
95b5617874 build-sys: Use $datadir for .proto files/codegen scripts
They are not arch-specific, so installing them in $libdir is not needed.
2015-10-02 12:51:51 +02:00
Jonathon Jongsma
017ddbe7a7 post-release version bump 2015-09-25 13:17:20 -05:00
Jonathon Jongsma
c9b3648f48 Update NEWS for 0.12.10 release 2015-09-22 15:30:54 -05:00
Frediano Ziglio
b397eca557 macros: fix compatibility with non-clang compilers
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-08-20 11:16:31 +01:00
Victor Toso
39be7a8fce macros: fix alignment issue reported by clang
char_device.c:131:52: warning: cast from 'uint8_t *'
(aka 'unsigned char *') to 'SpiceCharDeviceMsgToClientItem *'
(aka 'struct SpiceCharDeviceMsgToClientItem *')
increases required alignment from 1 to 8 [-Wcast-align]

 SpiceCharDeviceMsgToClientItem *msg_item = SPICE_CONTAINEROF(item,
                                            ^~~~~~~~~~~~~~~~~~~~~~~

../spice-common/spice-protocol/spice/macros.h:142:6: note: expanded
from macro 'SPICE_CONTAINEROF'

 ((struct_type *)((uint8_t *)(ptr) - SPICE_OFFSETOF(struct_type, member)))
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2015-08-20 11:05:19 +01:00
Victor Toso
fa19ebb83f macros: verify if __alloc_size__ works with clang
So we can avoid using using an attribute not supported for the compiler.

warning:
../spice-common/common/mem.h:91:80: warning: unknown attribute
'__alloc_size__' ignored [-Wunknown-attributes]

void *spice_malloc0_n(size_t n_blocks, size_t n_block_bytes)
SPICE_GNUC_MALLOC SPICE_GNUC_ALLOC_SIZE2(1,2);

../spice-common/spice-protocol/spice/macros.h:52:52: note: expanded
from macro 'SPICE_GNUC_ALLOC_SIZE2'

 #define SPICE_GNUC_ALLOC_SIZE2(x,y) __attribute__((__alloc_size__(x,y)))
                                                    ^
2015-08-20 11:00:35 +01:00
Frediano Ziglio
2cd036e9d4 Fix endianess compatibility with old GCC versions
GCC 4.4.7 does not define __BYTE_ORDER__ macros so use architecture
macro to attempt to detect endianess.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Reported-by: Swapna Krishnan <skrishna@redhat.com>
Tested-by: Swapna Krishnan <skrishna@redhat.com>
Acked-by: Uri Lublin <uril@redhat.com>
2015-08-19 15:42:10 +01:00
Christophe Fergeau
726c6520ae Use 0xffu everywhere in new SPICE_MAGIC_CONST macro
This should have been squashed in the commit introducing the macro, but
I forgot to commit this before pushing it.
2015-08-12 14:17:16 +02:00
Frediano Ziglio
295d05e733 Define and use new SPICE_MAGIC_CONST macro
This macro allow to define magic constants without using weird
memory tweacks.
This remove some possible warning from some compiler and
make code more optimized as compiler is able to compute the
constant.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-08-12 14:15:27 +02:00
Frediano Ziglio
3ab16f2dad Detects processor endianess using preprocessor
This allow to define macros based on endianess in public headers

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-08-12 14:15:27 +02:00
Christophe Fergeau
03a28f5856 build-sys: Make installed spice_codegen.py is executable
Files listed as _DATA in Makefile.am are installed without the
executable bit set, files listed as _SCRIPT do get the executable bit
set. As spice_codegen.py is meant to be run by spice-protocol users,
make sure this bit is set.
2015-08-10 18:00:45 +02:00
Christophe Fergeau
52ae5ed2c8 build-sys: Make sure aclocal picks up macros in the m4/ dir
Older aclocal version needs to have ACLOCAL_FLAGS defined in Makefile.am
in order to be able to pick up macros stored in m4/ in the source
directory.
2015-08-07 12:55:07 +02:00
Christophe Fergeau
3f0eaa717b build-sys: Add m4 file for AX_PYTHON_MODULE
This fixes a build failure on older distros (EL6) which do not have
this macro readily available.
2015-08-07 12:53:59 +02:00
Christophe Fergeau
8a3def14e3 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.
2015-08-07 12:07:26 +02:00
Christophe Fergeau
e857cd9a37 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.
2015-08-07 12:07:26 +02:00
Christophe Fergeau
1830e216c4 build-sys: Install code generation data/scripts
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.
2015-08-07 11:54:48 +02:00
Christophe Fergeau
2b9d15c1d3 build-sys: Add --enable-code-generator
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.
2015-08-07 11:54:47 +02:00
Christophe Fergeau
eb2e8ba0e8 build-sys: Make sure new files are dist'ed
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.
2015-08-07 11:54:46 +02:00
Christophe Fergeau
26eb4e0f2e Merge protocol code generation bits from spice-common
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
2015-08-07 11:52:25 +02:00
Sandy Stutsman
666b5c5780 Add VD_AGENT_CAP_MONITORS_CONFIG_POSITION capability to client.
This indicates the client's ability to handle multi-monitor
configurations that are not multi-head.

This commit addresses:
https://bugzilla.redhat.com/show_bug.cgi?id=1248196
https://bugzilla.redhat.com/show_bug.cgi?id=1248189
2015-08-06 11:52:00 +02:00
Uri Lublin
1d026b9a71 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
246825477f Post-release version bump 2015-07-29 17:46:59 +02:00
Christophe Fergeau
715c007eb0 Release 0.12.9 2015-07-29 17:44:07 +02:00
Christophe Fergeau
cd78176038 Rename SpiceImageCompress constants
Having these constants use the same name as the ones in spice-server
0.12.5 causes compilation issues for spice-server users when using
spice-server 0.12.5 or older, and spice-protocol 0.12.8.
2015-07-23 16:22:56 +02:00
Frediano Ziglio
de1286ad80 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
08384ac7fb codegen: Check we don't pop too many indexes 2015-07-23 11:22:11 +02:00
Frediano Ziglio
f6506a2563 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
25c48ddd2c 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
6f729cb32c 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
13aabda256 codegen: Remove duplicate variable initialization
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-07-23 11:11:44 +02:00
Frediano Ziglio
553be71067 codegen: Optimize code indentation and avoid a loop
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-07-23 11:11:18 +02:00
Frediano Ziglio
233c463e34 codegen: Fix typo in variable name
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-07-23 11:11:16 +02:00
Frediano Ziglio
5bad231e80 codegen: Simplify if/else blocks
Blocks were mainly the same, this reduces the amount of code.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2015-07-23 11:11:03 +02:00
Frediano Ziglio
4a2a996674 codegen: Import six module before first use
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-23 11:10:57 +02:00
Christophe Fergeau
9625b45edb codegen: Fix enums.h generation with python3
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-23 10:29:10 +02:00
Christophe Fergeau
5adcb1c340 proto: Remove space before tab
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-20 20:55:47 +02:00
Christophe Fergeau
4ba5072b28 Post-release version bump 2015-06-30 16:55:48 +02:00
Christophe Fergeau
4a4ab47db5 Prepare for spice-protocol 0.12.8 release 2015-06-30 16:31:31 +02:00
Sandy Stutsman
e93fdd47ef Add QXL_ESCAPE_MONITOR_CONFIG enum
New escape for sending monitor position information from guest to client
2015-06-30 16:23:42 +02:00
Javier Celaya
12ab27180b Proto: Add preferred compression message and constants.
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-22 19:54:30 +02:00
Javier Celaya
67fb3306f8 Add a preferred compression capability 2015-06-01 17:21:44 +02:00
Javier Celaya
da3cf3369a Update enums.h for preferred compression message 2015-06-01 17:21:44 +02:00
Christophe Fergeau
83dd73ba88 Post-release version bump
This allows spice-protocol users to depend on the git version.
spice-vdagent.git needs a spice-protocol version newer than the latest
release for the volume synchronization work or it won't build.
2015-05-27 12:43:07 +02:00
Victor Toso
9acfaa66df add volume synchronization to protocol
With VD_AGENT_AUDIO_VOLUME_SYNC the client can send volume and mute
values to be set in the guest for input or output devices.
Currently this is done once after the agent send its capabilities.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1012868
2015-04-14 16:11:03 +02:00
Christophe Fergeau
3cc9566a00 codegen: Use six.PY3 rather than six.PY2
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-14 16:08:43 +02:00
Alexander Wauck
e919337980 Make spice_codegen.py work on both Python 2 and 3
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-04-01 13:39:03 +02:00
Marc-André Lureau
fb50e86680 build-sys: simplify autogen
Use autoreconf, allow out of tree autogen.sh run.
2014-12-04 17:41:01 +01:00
Marc-André Lureau
2d7bf3ed7f vdi-dev: mark as deprecated
This interface has long been deprecated, and I don't know of any user.
Perhaps the header could even be removed from spice-protocol?
2014-12-04 17:39:08 +01:00
Javier Celaya
77ce36426f Add LZ4 image compression support.
- 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.
2014-12-02 19:23:53 +01:00
Javier Celaya
7566c5b3ad Add LZ4 compression display capability. 2014-12-02 19:08:59 +01:00
Fabiano Fidêncio
cb37de3520 python: Fix -Wsign-compare
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.
2014-09-18 13:13:30 +02:00
Fabiano Fidêncio
744675b424 python: Fix -Wunused-parameter
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.
2014-09-18 13:13:27 +02:00
Christophe Fergeau
1f6f9097c3 Release 0.12.7 2014-05-19 11:54:34 +02:00
Marc-André Lureau
3916b9d813 demarshal: prefix variable name with parent names
Avoid naming clash if parent structures have the same name

https://bugzilla.redhat.com/show_bug.cgi?id=1021995
2014-05-15 14:21:48 +02:00
Christophe Fergeau
06a99ce30b marshaller: Use #include <> for headers in $srcdir/common
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.
2014-04-16 16:47:55 +02:00
Christophe Fergeau
ef14521ac5 Use #include "common/..." in (de)marshallers
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.
2014-04-16 16:47:55 +02:00
Marc-André Lureau
58c1b4aeb8 Update enums.h for webdav channel 2014-03-19 17:55:23 +01:00
Marc-André Lureau
6e5ea8d802 spice.proto: add webdav channel
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.
2014-03-19 14:47:04 +01:00
Jeremy White
ee94b6b5f2 Add support for the Opus codec.
Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2014-01-02 12:28:21 +01:00
Jeremy White
2575626fb6 Add support for the Opus codec
Signed-off-by: Jeremy White <jwhite@codeweavers.com>
2014-01-02 12:24:02 +01:00
Marc-André Lureau
5ff3fa7080 vdagent: add max-clipboard message
Add an optional message sent by the client to ask the agent not to send
clipboard data bigger than a certain size, in bytes.  The message can be
sent if the agent supports the capability MAX_CLIPBOARD, at any time.

The agent is free to ignore or forget the value after a restart or a
disconnection, but a bigger message might be discarded when received on
client side, resulting in bandwidth waste.
2013-11-14 16:16:39 +01:00
Marc-André Lureau
9fc1e7e3d5 Mark VD_AGENT_CLIPBOARD_MAX as deprecated
There is no use for those 2 values, and the default limit would be quite
wrong.

Put them in a deprecated block. If someone uses them, he will have to
add -DSPICE_DEPRECATED, or just fix the code.
2013-11-14 16:14:22 +01:00
Jonathon Jongsma
960a360f8a Be explicit about spice-common license
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.
2013-10-23 11:41:43 -05:00
Jonathon Jongsma
f3a47cc903 codegen: Add a --generate-wireshark-dissector option
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.
2013-10-23 11:41:43 -05:00
Marc-André Lureau
8b436f8a3e macros: remove INLINE
This macro isn't used in the protocol headers, and clashes with other
define from qemu.
2013-10-04 12:36:24 +02:00
Marc-André Lureau
ba2192f1ea enums: add SPICE_MSG_BASE_LAST
Make it explicit that 100 is the last value of the base channel
messages. This allows clients to use the generated enum value too.
(see spice.proto)
2013-09-12 13:51:39 +02:00
Marc-André Lureau
23fe54f112 proto: add fake last message in base channel
Make it explicit that 100 is the last value of the base channel
messages. This allows clients to use the generated enum value too.
2013-09-12 13:49:25 +02:00
Marc-André Lureau
5dad55f008 proto: comment future surface flags usage 2013-09-12 13:49:25 +02:00
Yonit Halperin
784407f248 Release 0.12.6 2013-06-26 14:02:40 -04:00
Hans de Goede
7be0e88e7e vd_agent: Add caps for the agent to signal the guest line-ending (rhbz#752350)
When copy and pasting between a Linux guest and a Windows client or visa
versa, the line-endings of the text will usually be wrong for the other side,
so it is desirable to do automatic conversion.

However sometimes it is possible for text in the clipboard on Linux to have
MSDOS (CRLF) style line-endings, when copy and pasting from Linux to Linux
it is undesirable to automatically convert these, since this would not happen
when the apps were running directly on the same machine.

So we want to do automatic conversion only if the client and guest native
line-endings differ. This means that we cannot simply define one standard
line-ending for VD_AGENT_CLIPBOARD_UTF8_TEXT data.

Given the above it makes sense to only do conversion on one end. This
patch adds new capabilities which allow the guest-agent to advertise what
is the native line-ending of the guest.

This should be used by the client in the following way:
1) Check if the guest-agent advertises any line-ending type at all, if not
the guest line-ending is unknown -> do not convert
2) If the guest's native line-ending matches that of the platform the client
is running on, then do no not convert
3) If the guest's native line-ending is different from the client platform,
then convert received clipboard data into the client platform's native
line-ending, and convert clipboard data which will be send to the guest-agent
into the guest's native line-ending.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-06-05 14:23:52 +02:00
Yonit Halperin
bd3f609b34 add SPICE_MSG_PLAYBACK_LATENCY
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.
2013-04-22 11:34:49 -04:00
Yonit Halperin
1f603c09b8 add stream report messages
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.
2013-04-22 11:34:20 -04:00
Yonit Halperin
4f868cc354 add SPICE_MSG_PLAYBACK_LATENCY
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.
2013-04-22 11:30:49 -04:00
Yonit Halperin
a04cc68ba1 add SPICE_MSGC_DISPLAY_STREAM_REPORT
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.
2013-04-22 11:30:49 -04:00
Colin Walters
f3579abb3a autogen.sh: Honor NOCONFIGURE=1
See http://people.gnome.org/~walters/docs/build-api.txt
2013-03-21 23:01:34 +01:00
Hans de Goede
df6bc6269e Prepare for a 0.12.5 release
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-03-06 16:19:56 +01:00
Hans de Goede
c0808ab884 vd_agent: Add a new VD_AGENT_CLIENT_DISCONNECTED message
Client -> agent messages can spawn multiple VDIChunks. When this happens
the agent re-assembles the chunks into a complete VDAgentMessage before
processing it. The server only guarentees coherency at the chunk level,
so it is not possible for a partial chunk to get delivered to the agent.

But it is possible for some chunks of a VDAgentMessage to be delivered to
the agent followed by a client to disconnect without the rest of the
VDAgentMessage being delivered!

This will leave the agent in a wrong state, and the first messages send to it
by the next client to connect will get seen as the rest of the VDAgentMessage
from the previous client.

This patch introduces a new VD_AGENT_CLIENT_DISCONNECTED message which the
server will send from the VDP_SERVER_PORT on client disconnect, on which the
agent can then reset its VDP_CLIENT_PORT state.

Note that no capability is added for this, since capabilities are tracked
between the client and the agent only. The server will simply always send
this message on client disconnect, relying on older agents discarding the
message since it has an unknown type (which both the windows and linux agents
already do).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-03-05 14:41:09 +01:00
Hans de Goede
4fde54a2c6 vd_agent: Add a VD_AGENT_FILE_XFER_STATUS_SUCCESS result value
Currently the sender of a file xfer assumes success on having send the
last data bytes. But the transfer may still fail on the other side.

This commits adds a VD_AGENT_FILE_XFER_STATUS_SUCCESS result value instead.

Since we have not done an agent release with file-xfer support yet, the client
code can simply assume that it will always get *a* VD_AGENT_FILE_XFER_STATUS_
message for a transfer now. As for the existing spice-gtk release with
file-xfer support, if it talks to an agent sending this message, this will
trigger a g_return_if_fail, which is not really pretty, but has no negative
side-effects other then an error message being logged.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-02-28 14:02:18 +01:00
Marc-André Lureau
cf9600ad6e Post-release bump 2013-02-01 04:34:54 +01:00
Marc-André Lureau
6fd73785bb Release 0.12.4 2013-01-30 14:58:02 +01:00
Marc-André Lureau
720af3dff7 controller: add proxy message
Add a new string message for sending proxy details.
CONTROLLER_PROXY (ControllerData, string)

The value must be of the form [protocol://]<host>[:port]

The proxy string may be specified with a protocol:// prefix to specify
alternative proxy protocols.

If no protocol is specified in the proxy string or if the string
doesn't match a supported one, the proxy will be treated as a HTTP
proxy.
2013-01-28 14:29:15 +01:00
Hans de Goede
19198574ad vd_agent.h: add a VD_AGENT_CAP_SPARSE_MONITORS_CONFIG capability (rhbz#881072)
Currently the agent expect a monitor config to be continuous. If the user has
3 monitors (3 spice display windows) open and tries to disable the 2nd one,
then instead of the 2nd one being closed, the 3th one ends up closed.

To be able to fix this we need to be able to send a sparse monitor config
to the agent. A monitor being disabled in such a sparse config is simply
represented by its width and height being 0 in its VDAgentMonConfig.

Since old versions of the agent won't be capable of dealing with such a
0x0 sized monitor, this patch adds a new VD_AGENT_CAP_SPARSE_MONITORS_CONFIG
capability to signal to the client that the agent understands this, and
the client should only send sparse monitor configs to agents with this
capability.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2013-01-18 11:53:00 +01:00
Marc-André Lureau
2c010feeff build-sys: post-release bump 2013-01-16 13:51:10 +01:00
Dunrong Huang
a484ca8095 vd_agent.h: add file copy support
At present, Vmware and Virtualbox has supported file drag&drop feature,
I think it's a good feature for users, so we want qemu/spice to
supports it.

This patch first adds communication protocol between client and guest,
we must make the agent protocol stable before coding, this is what we
want this patch to do.

This feature has been discussed on spice mailing list.

The more details are available at following pages:
http://lists.freedesktop.org/archives/spice-devel/2012-November/011400.html
and
http://lists.freedesktop.org/archives/spice-devel/2012-November/011485.html

Signed-off-by: Dunrong Huang <riegamaths@gmail.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Marc-André Lureau <marcandre.lureau@redhat.com>
Cc: Alon Levy <alevy@redhat.com>
Cc: Uri Lublin <uril@redhat.com>
2013-01-11 21:55:31 +01:00
Hans de Goede
544b8ef187 Release 0.12.3 2012-12-20 15:49:10 +01:00
Marc-André Lureau
f188fb7a89 Add a "port" channel
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.
2012-12-05 11:24:05 +01:00
Marc-André Lureau
52ac6053a7 Add port channel enum values
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.

(See related spice.proto change in spice-common)
2012-11-30 13:41:55 +01:00
Christophe Fergeau
5b6127b207 Update git.mk to latest version
This way it will be in sync with spice-common and spice-gtk
2012-09-21 15:48:39 +02:00
Alon Levy
8c4e68701e update NEWS for release 0.12.2 2012-09-15 20:34:34 +03:00
Alon Levy
431ca865df Release 0.12.2
New in this release:
 display channel: A8 surface capability
 qxl: client present, client capabilities and client monitors configuration.
2012-09-12 16:54:11 +03:00
Alon Levy
d1a6f3dfd8 qxl_dev.h: add client monitors configuration notification to guest
So far we have used the agent to notify the guest of a request to change
the monitors configurations (heads) on the qxl device. This patch introduces
a new interrupt and new fields in the qxl rom to notify the guest about
a new request, similarly to how physical hardware notifies the driver.

We compute crc over the monitors configuration to avoid host-write from a
following update while guest-read corruption. The update protocol is:

qemu:
  (2) fill QXLRom::client_monitors_config
  (3) raise QXL_INTERRUPT_CLIENT_MONITORS_CONFIG

guest:
  (1) clear QXL_INTERRUPT_CLIENT_MONITORS_CONFIG bit in irq status
  (2) read QXLRom::client_monitors_config
  (3) (verify-crc)? done : goto 2

If the interrupt mask is ~0 or 0, or does not have
QXL_INTERRUPT_CLIENT_MONITORS_CONFIG set, we also assume it doesn't support
this interrupt.
2012-09-12 16:54:08 +03:00
Søren Sandmann Pedersen
361fd166b2 Add new client_present and client capabilities fields to QXLRom
The client_present field is a byte that is set of non-zero when a
client is connected and to zero when no client is connected.

The client_capabilities[58] array contains 464 bits that indicate the
capabilities of the client. Each bit corresponds to a
SPICE_DISPLAY_CAP_* capability. In particular, if the client has
capability C, then bit (C % 8) in byte (C / 8) is set. The capability
bits only have a defined meaning when a client is connected, ie., when
client_present is non-zero. The number 58 was chosen to fill out a
cache line in QXLRom.

A new QXL_INTERRUPT_CLIENT interrupt is defined, which will be raised
whenever a client connects or disconnects.
2012-09-02 15:15:29 -04:00
Søren Sandmann Pedersen
8459b35ec0 Add A8 surface capability
Even though the ability to handle a8 surfaces was added at the same
time as the composite command, they are logically separate, so add a
capability bit to indicate the presence of a8 surfaces.
2012-09-02 15:14:56 -04:00
Alon Levy
6e42db2750 Release 0.12.1 2012-09-02 21:18:38 +03:00
Marc-André Lureau
911dac9d60 inputs: add a INPUTS_KEY_SCANCODE message
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
2012-08-27 17:12:07 +02:00
Marc-André Lureau
3b619bd9c1 inputs: add an INPUTS_KEY_SCANCODE message
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 from a single message.

If the server doesn't support INPUTS_CAP_KEY_SCANCODE, the client is
responsible to handle a fallback mode with the exisiting KEY_DOWN and
KEY_UP messages.

See also: https://bugzilla.redhat.com/show_bug.cgi?id=812347
2012-08-27 17:10:48 +02:00
Yonit Halperin
76712d6afa support seamless migration
see spice-protocol for more details
commit 3838ad140a
2012-08-27 09:06:26 +03:00
Yonit Halperin
6838a4fed0 add SPICE_MSG_MAIN_AGENT_CONNECTED_TOKENS
The msg is used for setting the number of allocated client tokens when
we notify the client that the agent is attached.
2012-08-27 09:02:05 +03:00
Yonit Halperin
3838ad140a seamless migration support
The main difference between semi-seamless and seamless migration is that
while in semi-seamless migration the state of all the channels is
being completely reset after migration is complete, in seamless migration
the essential parts of the state are restored on the server side, and
are left the same on the client side. semi-seamless migration is
equivalent to having the client disconnect from the src and connected
from scratch to the dest, with the exception, that the handshake with
the dest server occurs before the client has disconnected from the src.
In semi-seamless migration in-flight data gets lost, e.g., a file
transfer to a usb device might be disrupted.

=======================
===protocol details====
=======================

Let s1, s2, and c be the src server, dest server and client, respectively.

Semi-Seamless migration protocol
================================

pre-migration phase:
--------------------
(1) s1->c: SPICE_MSG_MAIN_MIGRATE_BEGIN
    In response, c tries to establish a connection to s2. After the connection is
    established, it is inactive (the client doesn't attempt to read or
    write messages from/to it)
(2) c->s1: SPICE_MSGC_MAIN_MIGRATE_CONNECTED or
           SPICE_MSGC_MAIN_MIGRATE_CONNECT_ERROR

post migration phase:
---------------------
(1) s1->c: SPICE_MSG_MAIN_MIGRATE_END or
           SPICE_MSG_MAIN_MIGRATE_CANCEL
    In case of the former, c disconnects from s1, resets all its
    channels states and switches to an active connection with s2.
(2) c->s2: SPICE_MSGC_MAIN_MIGRATE_END
    The msg signals that all the channels have been migrated successfully to s2.

Seamless migration protocol
===========================

pre-migration phase:
--------------------
In case qemu/libvirt/client do not support seamless migration,
s1 takes the semi-seamless pathway for migration. Otherwise:

(1) s1->c: SPICE_MSG_MAIN_MIGRATE_BEGIN_SEAMLESS (*New*)
    The msg includes the version of the migration protocol
    of s1.
    In response c tries to establish a connection to s2.
(2)
    If the connection fails:
    (2.1) c->s1: SPICE_MSGC_MAIN_MIGRATE_CONNECT_ERROR

    If s2 supports SPICE_MAIN_CAP_SEAMLESS_MIGRATE:
    (2.2) c->s2: SPICE_MSGC_MAIN_MIGRATE_DST_DO_SEAMLESS (*New*)
          The msg includes the version of the migration protocol
          of s1. The msg is used for querying s2 if seamless migration
          is possible, given the migration protocol version of s1.

      (2.2.1) s2->c: SPICE_MSG_MAIN_MIGRATE_DST_SEAMLESS_ACK/NACK (*New*)
      (2.2.2) c->s1: SPICE_MSGC_MAIN_MIGRATE_CONNECTED_SEAMLESS (*New*) or
                     SPICE_MSGC_MAIN_MIGRATE_CONNECTED
              The latter is sent when c receives SEAMLESS_NACK, and
              indicates s1 to apply semi-seamless protocol on post
              migraion phase.

    If s2 does not support SPICE_MAIN_CAP_SEMI_SEAMLESS_MIGRATE:
    (2.3) c->s1: SPICE_MSGC_MAIN_MIGRATE_CONNECTED
          (see 2.2.2)

post migration phase:
---------------------
While the pre migration phase was conducted by the main channel, this
phase's protocol occurs in all the migrated channels.

(1) s1->c: SPICE_MSG_MIGRATE
    The msg marks the client that the connection is paused from s1 side, and
    next to this msg, the only possible msg s1 can send is
    SPICE_MSG_MIGRATE_DATA

    msg optional flags:
    (a) MIGRATE_FLUSH_MARK
        This flag is required for finalizing the channel connection
        without losing any in-flight data.
        This flag indicates that s1 expects SPICE_MSGC_MIGRATE_FLUSH_MARK,
        for signaling that c will pause the connection and not send any more messages
        to s1.
    (b) MIGRATE_DATA
        The flag indicates that c should receive from s1
        SPICE_MSG_MIGRATE_DATA
(2) c->s1: SPICE_MSGC_MIGRATE_FLUSH_MARK (if required)
    c pushes the msg to the head of its output msg queue,
    and sends it before all its other pending msgs - they will be sent to s2
    later.
(3) s1->c: SPICE_MSG_MIGRATE_DATA (if required)
    The msg contains all the data that the server requires for restoring
    the channel's state on s2 side correctly.
(4) c disconnects the channel from s1 and switches to an active connection
    with s2.
(4) c->s2: SPICE_MSGC_MIGRATE_DATA
2012-08-27 08:59:46 +03:00
Yonit Halperin
c20bc58c4e add SPICE_MSG_MAIN_AGENT_CONNECTED_TOKENS
Similarly to SPICE_MSG_AGENT_CONNECTED, the msg notifies the main
channel about attaching an agent. In addition the msg also contains the
number of tokens allocated to the client.
2012-08-27 08:59:46 +03:00
Søren Sandmann Pedersen
b3eba427bf Add support for A8 images to the LZ routines
This format is needed to add Render support to the X driver, so we
need the ability to compress and decompress it.
2012-08-24 13:37:51 -04:00
Søren Sandmann Pedersen
473a14b39f Add support for QXLComposite to the Spice protocol headers
This new command is intended to be used for implementing the Composite
request from the Render X extension. See

   http://www.x.org/releases/current/doc/renderproto/renderproto.txt

for a description of the Render extension.

Composite has three fields: src, mask and destination, of which mask
is optional (can be NULL). There are also two pointers to
transformations, one for each of src and mask.

The command also has 32 bits of flags which indicates

- which compositing operator to use
- which filters to apply when sampling source and mask
- which repeat mode to apply when sampling source and mask
- whether the mask should be considered to have 'component alpha'
- whether the alpha channel of any of the images should be ignored.

The last one of these features is necessary because in the X protocol
an offscreen surface is simply a collection of bits with no visual
interpretation. In order for Render to use these bits, a wrapper
object is used that contains the pixel format. Since one offscreen
surface can be wrapped by multple objects, there is not a one-to-one
correspondence between pixel formats and surfaces.

In SPICE surfaces do have an associated pixel format, which means the
above feature of Render cannot be supported without adding a similar
concept to the wrapper object to the SPICE protocol. However, the most
common use for having multiple wrappers for one offscreen surface is
to interpret an alpha surface as not having an alpha channel or vice
versa.
2012-08-22 10:58:17 -04:00
Søren Sandmann Pedersen
1d65b9016f Add an 8BIT_A format
This format corresponds to a sequence of bytes, each of which
represents an alpha value.
2012-08-13 10:42:49 -04:00
Marc-André Lureau
1e378a1049 Release 0.12.0 2012-07-16 18:32:25 +02:00
Alon Levy
e85c454a1e support multiple monitors in single display channel
See spice-protocol commit for details:
 da908f89b5
 support multiple monitors on a single display channel
2012-07-12 19:50:40 +03:00
Alon Levy
da908f89b5 support multiple monitors on a single display channel
Adds on device:

RAM
 Header
  monitors_config - pointer

 QXLMonitorsConfig
  count == n
  max_allowed = N >= 0
  QXLHead 1
  ...
  QXLHead n
   id, surface_id, x, y, width, height, flags

IO:
 QXL_IO_MONITORS_CONFIG
  server flushes command ring, then calls server callback for changing monitors config.

New revision to let the driver know about the new io:
 QXL_REVISION_STABLE_V12=0x04,

Adds server/client capability:
 SPICE_DISPLAY_CAP_MONITORS_CONFIG

Server message will be added in spice-server and spice-common.

Version is bumped to 0.12.0 to indicate new IO and structs
2012-06-27 16:57:05 +03:00
Alon Levy
86eb1a334e enums.h: update for smartcard updated spice.proto 2012-06-22 17:20:51 +03:00
Alon Levy
8738ce1c5e smartcard: build fixes for spice server
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.
2012-06-14 13:53:46 +03:00
Alon Levy
341f33cbdb python_modules/ptypes.py/EnumBaseType.c_enumname: add missing return to fix 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.
2012-06-14 13:53:46 +03:00
Marc-André Lureau
26cd1946a5 Add QXL_ESCAPE_SET_CUSTOM_DISPLAY
QXL_ESCAPE_SET_CUSTOM_DISPLAY is Windows specific message
to tell the display & miniport driver to update the mode
table with a custom resolution.

The mode table needs to be forcefully refreshed after
setting a custom display, it can be done by querying an
invalid/unknown mode:

EnumDisplaySettings(dev_name, 0xffffff, &tempDevMode);
2012-05-11 18:19:25 +02:00
Alon Levy
0d01de3108 Release 0.10.3 2012-05-08 18:23:02 +03:00
Yonit Halperin
543faaf796 video streaming: add support for frames of different sizes
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.
2012-05-02 14:47:29 +03:00
Yonit Halperin
bf0daeb3a3 video streaming: add support for frames of different sizes
rhbz #815422

Add SPICE_MSG_DISPLAY_STREAM_DATA_SIZED, for stream_data message
that in addition to the mjpeg data, also contains the
(1) width and height of the compressed frame.
(2) the destination box of the frame.
The server can send such messages only to clients with
SPICE_DISPLAY_CAP_SIZED_STREAM.

When playing a youtube video on Windows guest, the driver sometimes sends
images which contain the video frames, but also other parts of the
screen (e.g., the youtube process bar). In order to prevent glitches, we send these
images as part of the stream, using SPICE_MSG_DISPLAY_STREAM_DATA_SIZED.
2012-04-24 08:25:28 +03:00
Alon Levy
8a20378425 qxl_dev: fix const cast warning for QXL_R[AO]M_MAGIC 2012-04-09 20:05:10 +03:00
Christophe Fergeau
725b5a9b53 demarshall: add missing parens in BE read_xxx functions
The missing parens causes build to fail on big-endian machines
2012-04-06 15:32:02 +02:00
Christophe Fergeau
2d24f61aae Add controller messages for USB redirection
This adds 3 new controller messages:

CONTROLLER_ENABLE_USB (ControllerValue, boolean)
CONTROLLER_ENABLE_USB_AUTOSHARE (ControllerValue, boolean)
CONTROLLER_USB_FILTER (ControllerData, string)

This fixes rhbz #807295
2012-04-03 10:31:57 +02:00
Christophe Fergeau
f799ed89e8 Fix typo in comment 2012-04-03 10:31:29 +02:00
Yonit Halperin
8cf92f0423 controller: add COLOR_DEPTH and DISABLE_EFFECTS messages
rhbz #787447

Signed-off-by: Yonit Halperin <yhalperi@redhat.com>
2012-04-02 10:12:57 +03:00
Marc-André Lureau
534d35cc32 build-sys: make it a seperately buildable spice-common library
- autotoolize
- fix headers inclusion
- generate gitignores
- workaround serverSMARTCARD support with dirty hack...
2012-03-22 20:21:05 +01:00
Marc-André Lureau
15dba2901b spice.proto: fix demarshaller crash with name message
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
2012-03-21 13:24:17 +01:00
Marc-André Lureau
3215ddd6cd codegen: ifdef/endif function declaration too
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
2012-03-21 13:24:17 +01:00
Marc-André Lureau
055c68ccdd codegen: include headers locally 2012-03-21 13:24:17 +01:00
Marc-André Lureau
ecce70452f codegen: struct marshallers are not current function helper
This solves the issue of struct_marshallers being included within the
current ifdef/endif body, although they are independant functions.
2012-03-21 13:24:16 +01:00
Christophe Fergeau
94a46ebc2a use new @ifdef directive for smartcard messages
We don't want to conditionally compile the smartcard messages
depending on whether USE_SMARTCARD is set or not, we can now use
the @ifdef attribute for that.
2012-03-20 15:31:30 +01:00
Christophe Fergeau
617b0adac3 add smartcard bits to spice.proto 2012-03-20 15:31:30 +01:00
Hans de Goede
ca57afda34 spice_codegen: Always write a channels entry for an ifdef-ed channel
Before this patch, if a channel is defined conditionally in spice.proto
(because it depends on external headers like the smartcard channel),
spice_codegen would write an entry to the channels array in
spice_get_*_channel_parser which would only take up a place in the array
if the ifdef condition is true, thus moving up all other intializers
one place when it is not true. This was causing issues (crashes) when building
spice-gtk with the combination of usbredir support enabled and smartcard
support disabled.

This patch fixes this by adding #else { NULL, 0 }, to the generated code.

Thanks to coolper chen <lixin.chen@saicocch.com> for reporting this!

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-03-20 15:31:30 +01:00
Christophe Fergeau
12a5ce3dc5 handle @ifdef on messages and channels 2012-03-20 15:31:30 +01:00
Christophe Fergeau
0067c31bad allow attributes on channel elements in .proto files
We want to be able to add an @ifdef annotation to optional messages
For example, we want to compile in the smartcard messages only if
libcacard is available
2012-03-20 15:31:30 +01:00
Christophe Fergeau
d8975877c6 add ifdef/endif methods to spice code generator
These methods will be needed to be able to make some fields optional
in spice.proto
2012-03-20 15:31:30 +01:00
Christophe Fergeau
7f23ab54aa fix copy & paste error in ptypes.py 2012-03-20 15:31:30 +01:00
Marc-André Lureau
7220080972 Send name & uuid to capable clients
Add spice_server_set_name() and spice_server_set_uuid() that allows
the client to identify a Spice server (useful to associate settings
with a particular server)

The SPICE_MSG_MAIN_NAME and SPICE_MSG_MAIN_UUID messages are only sent
to capable clients, announcing SPICE_MAIN_CAP_NAME_AND_UUID.
2012-03-20 15:25:56 +01:00
Marc-André Lureau
36ea49b686 demarshal: fixed-size array are missing __nelements
A message with a fixed-size array, such as uint8 uuid[16] will
generate an invalid code, missing the __nelements variable. Make sure
that variable is defined.
2012-03-20 15:25:56 +01:00
Daniel P. Berrange
ce59cc1416 Remove trailing blank lines
Remove any blank lines at the end of all source files
2012-03-20 15:25:55 +01:00
Yonit Halperin
b444b76655 spice.proto: add SPICE_MSG_LIST to base channel 2012-03-20 15:25:54 +01:00
Hans de Goede
cdb54a8fa5 codegen: Fix enums.h generation
With the new usbredir code we have the new concept of the abstract /
generic spicevmc channel type (which just tunnels data from a qemu chardev),
and we've the usbredir channel, which is the only current user of this.

This was reflected in the protocols enum in spice-protocol.h by a manual
edit done by me, my bad. This patch teaches spice.proto about the relation
between the abstract spicevmc channel and the usbredir channel and
modifies codegen to deal with this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2012-03-20 15:25:54 +01:00
Yonit Halperin
f74d9176a7 spice.proto: add SPICE_MSG_MAIN_MIGRATE_END & SPICE_MSGC_MAIN_MIGRATE_END
(cherry picked from commit cfbd07710562e522179ae5a7085a789489a821bb branch 0.8)
2012-03-20 15:25:54 +01:00
Yonit Halperin
b530ce7ea2 server,proto: tell the clients to connect to the migration target before migraton starts
(1) send SPICE_MSG_MAIN_MIGRATE_BEGIN upon spice_server_migrate_connect
    (to all the clients that support it)
(2) wait for SPICE_MSGC_MAIN_MIGRATE_(CONNECTED|CONNECT_ERROR) from all the relevant clients,
    or a timeout, in order to complete client_migrate_info monitor command
(cherry picked from commit 5560c56ef05c74da5e0e0825dc1f134019593cad branch 0.8;
 Was modified to support the separation of main channel from reds, and multiple clients)

Conflicts:

	server/reds.c
2012-03-20 15:25:54 +01:00
Alon Levy
40ef2d5459 spice.proto: add comment for origin of STYLED and START_WITH_GAP 2012-03-20 15:25:54 +01:00
Hans de Goede
85da46bacd server: Add a usbredir channel 2012-03-20 15:25:54 +01:00
Christophe Fergeau
4b6598dc02 don't #include config.h in generated header files
7e30572ab adds a #include <config.h> to the beginning of generated
files. It also does this for generated headers and enums files,
which is not wanted, especially if it's an installed file. This
commit only adds this include for the non-header non-enum case
(hopefully, enums are only generated for use in a .h file).
2012-03-20 15:25:53 +01:00
Christophe Fergeau
a11615f713 add check for pyparsing
Check both in configure.ac (after checking if we need to rebuild
the marshalling files) and in the python script using pyparsing
(for people modifying .proto files in tarballs)
2012-03-20 15:25:53 +01:00
Marc-André Lureau
da5cad88e3 sndworker: add AudioVolume/AudioMute messages
These messages allow the guest to send the audio device volume to the
client. It uses an arbitrary scale of 16bits, which works good enough
for now.

Save VolumeState in {Playback,Record}State, so that we can send the
current volume on channel connection.

Note about future improvements:
- add exact dB support
- add client to guest volume change

Updated since v2:
- bumped record and playback interface minor version to allow
  conditional compilation
Updated since v1:
- sync record volume on connection too
2012-03-20 15:25:53 +01:00
Marc-André Lureau
bbd93cdb6b python: remove c-ism trailing ; 2012-03-20 15:25:53 +01:00
Marc-André Lureau
d14c99b84f codegen: typedef the protocol enums
Commit 9d5ef9beec in spice-protocol
introduced a typedef manually in the generated enums.h header.

This patch adds them automatically to all enums during enums.h generation.
2012-03-20 15:25:53 +01:00
Christophe Fergeau
12be0ad2ae add comment to beginning of autogenerated files 2012-03-20 15:25:52 +01:00
Christophe Fergeau
975ebc9b7d add config.h to autogenerated files too
Modify the python (de)marshaller generator to add #include
<config.h> at the beginning of the C files it generates
2012-03-20 15:25:52 +01:00
Alon Levy
fbead3281f spice.proto: Fill.rop_descriptor type s/uint16/ropd (10x atiti) 2012-03-20 15:25:51 +01:00
Alon Levy
f7986c2b0d python_modules/codegen.py: fix indent error in an unused function 2012-03-20 15:25:51 +01:00
Uri Lublin
a2257eff31 spice-client migration: fix minor for old migration support.
For not too old spice-migration, minor is 1.
For older (ancient) spice-migration, minor is 0.

Affects only VM migration while a spice client is connected.
2012-03-20 15:25:51 +01:00
Alon Levy
3a6de6d6fb demarshaller/marshaller fix gcc 4.6.0
python_modules/demarshal.py and marshal.py fixes for gcc 4.6.0
warning about set but unused variables. The fixes disable creating
of variables mem_size when they are not used (demarshall) and
declaring a src variable when the message doesn't use it (marshal).

You need to touch *.proto after applying this (should add a Makefile
dependency).
2012-03-20 15:25:50 +01:00
Alon Levy
d6f198b3f4 codegen: avoid creating out if not used (fix gcc 4.6.0 warning) 2012-03-20 15:25:50 +01:00
Alon Levy
11269608a7 mingw32 build: python_modules/marshal: use unsigned for for_loop index variable 2012-03-20 15:25:50 +01:00
Alon Levy
8a40c89280 smartcard: add to spice.proto 2012-03-20 15:25:50 +01:00
Alon Levy
005ecaa7d6 spice codegen: fix copy-o, no such variable value 2012-03-20 15:25:50 +01:00
Alon Levy
aa7a086933 support python 2.5.4+ for marshaller/demarshallers
Patch adds a "from __future__" import that doesn't affect newer python's but
allows python 2.5.4 to run the code (tested under scratchbox, n900 build environment)
2012-03-20 15:25:49 +01:00
Alexander Larsson
aae971c6ab demarshaller: Fix palette marshalling
It turns out that using base + sizeof(struct) is not a good way to
access an array at the end of a struct. For SpicePalette sizeof is 16, but
offset of ents is 12. Using this calculation in the demarshaller breaks
things badly, so now we use the actual array member.
2012-03-20 15:25:49 +01:00
Alexander Larsson
7861ba0921 Don't send padding over the network with video data 2012-03-20 15:25:49 +01:00
Alexander Larsson
12bc82da5c Fix uninitialized variable warnings 2012-03-20 15:25:49 +01:00
Alexander Larsson
4702feb5b1 Don't send CursorHeader if cursor_flags is NONE 2012-03-20 15:25:49 +01:00
Alexander Larsson
f3d92c736b Send Clip.rects inline rather than using a pointer 2012-03-20 15:25:49 +01:00
Alexander Larsson
f008b7605d codegen: Allow @to_ptr to make inline structs demarshal as pointers 2012-03-20 15:25:49 +01:00
Alexander Larsson
d9629ca4e7 codegen: Various cleanups
Remove all uses of @end in the marshaller, instead just using
the C struct array-at-end-of-struct. To make this work we also remove
all use of @end for switches (making them C unions).

We drop the zero member of the notify message so that we can avoid this
use of @end for a primitive in the marshaller (plus its useless to send
over the wire).

We change the offsets and stuff in the migration messages to real pointers.
2012-03-20 15:25:48 +01:00
Alexander Larsson
373993f32c codegen: Pass member to SubMarshallingSource rather than name
This way we can check attributes on the member.
2012-03-20 15:25:48 +01:00
Alexander Larsson
e6240ee0b0 codegen: Remove unused methos has_pointer() 2012-03-20 15:25:48 +01:00
Alexander Larsson
9e2e061bea Don't marshall bitmap data as pointer, instead send inline 2012-03-20 15:25:48 +01:00
Alexander Larsson
42c5286ca6 Make distcheck work 2012-03-20 15:25:48 +01:00
Alexander Larsson
adce65685f Fix various misspellings
letancy -> latency
compund -> compound
SpicedSubMessage -> SpiceSubMessage
modifaiers -> modifiers
massage -> message
outgoiong -> outgoing
AlphaBlnd -> AlphaBlend
remoth -> remote
modifires -> modifiers
secore -> secure
2012-03-20 15:25:48 +01:00
Alexander Larsson
a09be53ea8 Fix inclusion of common files, no need for common/ part 2012-03-20 15:25:48 +01:00
Alexander Larsson
74f9cd9f73 codegen: No SPICE_ADDRESS types left, drop @c_ptr 2012-03-20 15:25:47 +01:00
Alexander Larsson
2952d5bd9a Properly parse QXLLineAttrs.style 2012-03-20 15:25:47 +01:00
Gerd Hoffmann
0ed056da99 Properly parse QXLImage to the new-world SpiceImage
SpiceImage now replaces RedImage and has all image types in it.
All image data are now chunked (and as such not copied when demarshalling).
2012-03-20 15:25:47 +01:00
Alexander Larsson
4a12b9c0dd codegen: support @chunk on non-pointer arrays
This is similar to @as_ptr, but generates a single chunk of data.
2012-03-20 15:25:47 +01:00
Alexander Larsson
1b432de3b9 Add support for @chunk 2012-03-20 15:25:47 +01:00
Alexander Larsson
5492b3ccae marshaller: Make get_nw_offset() handle deep member references 2012-03-20 15:25:47 +01:00
Alexander Larsson
6ca5b39e6f Convert SpicePath.segments to a pointer array 2012-03-20 15:25:47 +01:00
Alexander Larsson
bb1d862989 Handle extra size for switch and array the right way
Even for is_extra_size() we should calculate the mem_size for
arrays, its just that the parent type (in this case switch) should
request mem_size if the type is_extra_size.
2012-03-20 15:25:47 +01:00
Alexander Larsson
daaf4865d8 marshaller: Add some docs describing the types of sizes 2012-03-20 15:25:47 +01:00
Alexander Larsson
32481bf381 marshaller: Make @nonnull a propagated attribute
This cleans up some stuff
2012-03-20 15:25:47 +01:00
Alexander Larsson
f22381505d marshaller: Make @c_ptr a propagated attribute
This simplifies some code
2012-03-20 15:25:47 +01:00
Alexander Larsson
fefc89c6c4 marshaller: Add generic way to handle propagating attributes
Also switches @ptr_array to use this
2012-03-20 15:25:47 +01:00
Gerd Hoffmann
6228ae633e Properly parse and marshall SpiceString 2012-03-20 15:25:46 +01:00
Alexander Larsson
8ec1247dbe Fix 32bit failure in demarshaller
Due to a typo we always read offsets as pointers, never as SPICE_ADDRESS.
2012-03-20 15:25:46 +01:00
Alexander Larsson
6d38c4817f Simplify SpiceLineAttr by removing unsed stuff
Also in new protocol don't send style data if not needed.
2012-03-20 15:25:46 +01:00
Alexander Larsson
68e29d0d19 Automatically marshall SpiceClipRects 2012-03-20 15:25:46 +01:00
Alexander Larsson
e191e47238 Automatically marshall SpicePath 2012-03-20 15:25:46 +01:00
Alexander Larsson
02a429e46e Support @marshall to automatically marshall pointers 2012-03-20 15:25:46 +01:00
Alexander Larsson
e42c910b5c Store SpicePath segment count rather than size
Internally and in the network protocol (for the new version) we
now store the actual number of segments rather than the size of the
full segments array in bytes. This change consists of multiple changes
to handle this:

* Make the qxl parser calculate num_segments
* Make the canvas stroke code handle the new SpicePath layout.
* Fix up is_equal_path in red_worker.c for the new layout
* replace multiple calls to spice_marshall_PathSegment with a single
  spice_marshall_Path call
* Make the byte_size() array size handling do the conversion from
  network size to number of elements when marshalling/demarshalling.
* Update the current spice protocol to send the segment count rather than
  the size
* Update the old spice protocol to use the new byte_size functionallity
  to calculate the size sent and the number of elements recieved
2012-03-20 15:25:46 +01:00
Alexander Larsson
140cf2aa79 Update client and protocol to support the new SpiceClipRects 2012-03-20 15:25:46 +01:00
Alexander Larsson
13f8149daf demarshaller: Support @c_ptr attributes for pointers
A @c_ptr pointer is stored in memory as a real pointer rather than a
SPICE_ADDRESS. This is a temporary thing that will be removed again
when all SPICE_ADDRESSes have been converted to real pointer.
2012-03-20 15:25:46 +01:00
Alexander Larsson
dcaba909d3 demarshaller: Don't parse @zero members
These just write zeros at the right place in the network protocol
typically for old back-compat things. We don't want to read these
back in.
2012-03-20 15:25:46 +01:00
Gerd Hoffmann
f2d7fbdb19 qxl abi: parse QXLCopy + QXLBlend.
Also adapt to tyops fix (s/rop_decriptor/rop_descriptor/).
2012-03-20 15:25:46 +01:00
Gerd Hoffmann
54fc0642e1 qxl abi: parse QXLOpaque.
Also adapt to tyops fix (s/rop_decriptor/rop_descriptor/).
2012-03-20 15:25:45 +01:00
Gerd Hoffmann
435b1515a7 qxl abi: parse QXLFill.
Also adapt to tyops fix (s/rop_decriptor/rop_descriptor/).
2012-03-20 15:25:45 +01:00
Alexander Larsson
144b2fbd75 Fix build error due to member "SpiceMsgEmpty" same name as type 2012-03-20 15:25:45 +01:00
Alexander Larsson
302788f147 spice.proto: surface_create.format is of type surface_fmt 2012-03-20 15:25:45 +01:00
Alexander Larsson
8b4ab9026d Use smaller size for enums and flags on the network
This makes the protocol more compact. This was mainly done for the commonly
used types. Some seldom used ones are still 32bit for future compatibility.
2012-03-20 15:25:45 +01:00
Alexander Larsson
7578be4a23 Remove support for clip by path
This is not supported currently anyway and was not generated before.
2012-03-20 15:25:45 +01:00
Alexander Larsson
fc30c38a94 spice.proto: No need for @ptr32 as that is now the default 2012-03-20 15:25:45 +01:00
Alexander Larsson
baa0718cec spice.proto: Don't use @fixedsize for Brush
There is no reason to send the maximum size on the network, that is just
a waste of space most of the time.
2012-03-20 15:25:45 +01:00
Alexander Larsson
31fd48e773 Don't send zero data item for clips with no data 2012-03-20 15:25:45 +01:00
Alexander Larsson
1d5d5272e2 Make pointers 32bit in new protocol format 2012-03-20 15:25:45 +01:00
Alexander Larsson
db5b8fa673 marshaller: Correctly determine if switches are fixed size
Switches are fixed size only if all cases have the same size *and*
it has a default case or all the valid cases are listed.
2012-03-20 15:25:45 +01:00
Alexander Larsson
32dbd8a6a5 Fix handling of @ptr32 network size 2012-03-20 15:25:45 +01:00
Alexander Larsson
2ef7116925 Remove minor markup in unstable protocol as we're resetting minor to 0 2012-03-20 15:25:45 +01:00
Alexander Larsson
fbf883085f Add spice1.proto describing the 0.4 version of the network protocolx 2012-03-20 15:25:44 +01:00
Alexander Larsson
ee944c8314 Add support for @virtual markup in spice protocol
This means the member is not sent on the network at all.
Instead its initialized to the attribute argument when demarshalled.

This is useful for backwards compatibility support.
2012-03-20 15:25:44 +01:00
Alexander Larsson
9f3a36f3f9 Make internal generated marshaller functions static 2012-03-20 15:25:44 +01:00
Alexander Larsson
2523cec8c4 Support extra prefix in code generators
This is require when we add a new spice.proto for the old (major 1)
protocol description.
2012-03-20 15:25:44 +01:00
Alexander Larsson
38412df9aa Support creating marshallers that are called indirectly
This is needed if we want to switch marshallers depending on what
major version the remote side has.
2012-03-20 15:25:44 +01:00
Alexander Larsson
f9610c1a65 Add destructor for demarshalled messages
This is required because we don't want to free messages that just
refer to the unparsed message (like SpiceMsgData).

Also, in the future we might need it for more complex demarshalling.
2012-03-20 15:25:44 +01:00
Yonit Halperin
1f3c193ceb Lossy compression of RGBA images (on WAN connection)
The RGB channels are compressed using JPEG.
The alpha channel is compressed using LZ.
2012-03-20 15:25:44 +01:00
Yonit Halperin
e8ee21132b applying zlib compression over glz on WAN connection 2012-03-20 15:25:44 +01:00
Alexander Larsson
b49b77d8e9 Make generated marshallers build on win32 2012-03-20 15:25:44 +01:00
Alexander Larsson
a0a1907716 Make sound data @as_ptr to avoid copying data 2012-03-20 15:25:44 +01:00
Alexander Larsson
4b670111a0 Make ping data @as_ptr to avoid copying data 2012-03-20 15:25:44 +01:00
Alexander Larsson
98d3b1d5c3 Make cursor data @as_ptr to avoid copying data 2012-03-20 15:25:44 +01:00
Alexander Larsson
41c07b938b Support @as_ptr in demarshaller to avoid copying data unnecessary 2012-03-20 15:25:44 +01:00
Alexander Larsson
405900c4a2 Allow multiple --include args 2012-03-20 15:25:43 +01:00
Alexander Larsson
d802d7e7f8 Make tunnel_service_add members be of cstring array size 2012-03-20 15:25:43 +01:00
Alexander Larsson
3114699378 Use @ptr32 for 32bit offsets in spice.proto 2012-03-20 15:25:43 +01:00
Alexander Larsson
27238241f0 Add @nomarshal in a few places where we're marshalling manually 2012-03-20 15:25:43 +01:00
Alexander Larsson
a4cb48f1ba spice.proto: add @outvar markup
With this we can reference pointer member with no naming conflicts
2012-03-20 15:25:43 +01:00
Alexander Larsson
79bd3284c6 Add support for generating message and structure marshallers 2012-03-20 15:25:43 +01:00
Alexander Larsson
809524ac5d Add python code to automake system 2012-03-20 15:25:43 +01:00
Alexander Larsson
b1dc7fae2a Initial import of spice protocol description and demarshall generator
The "spice.proto" file describes in detail the networking prototcol
that spice uses and spice_codegen.py can parse this and generate
demarshallers for such network messages.
2012-03-20 15:25:43 +01:00
Marc-André Lureau
32da251a65 build-sys: use git.mk 2012-03-19 21:12:18 +01:00
Marc-André Lureau
1a3b563171 Add name & uuid messages on main channel
This allows a client to identify a Spice server. This can be useful to
associate data/configuration with this particular server.

The corresponding main channel messages are:

    message {
	uint8 uuid[16];
    } uuid;

    message {
	uint32 name_len;
	uint8 name[name_len] @end @nomarshal; \* \0 terminated *\
    } name;

Those messages are sent by the server only if the capability
SPICE_MAIN_CAP_NAME_AND_UUID is available on the client, and the
server has the relevant data.
2012-03-05 18:12:42 +01:00
Marc-André Lureau
d5edafd28a build: include spice/types.h in foreign_menu_prot.h
The header uses some types only defined in stdint.h. Apparently, the
rest of the headers include types.h for that.
2012-02-23 22:18:34 +01:00
Marc-André Lureau
cda88623d0 build: clean up build to not be dirty after autogen 2012-02-22 15:37:58 +01:00
Marc-André Lureau
d9de9213f2 Add controller message ENABLE_SMARTCARD
The sent message must be a ControllerValue whose value is either '0'
disabled, or '1' enabled.
2012-02-17 17:39:22 +01:00
Yonit Halperin
54ef19ea33 Release 0.10.1 2012-01-12 16:29:02 +02:00
Yonit Halperin
49e2069467 Add support for mini header: an header without sub list & without serial
-Add SpiceMiniDataHeader.
-Introduce capability SPICE_COMMON_CAP_MINI_HEADER.

The advantage of using a header without sub list is to spare the 4 bytes that were sent
for a lot of messages without sublist.
Instead, messages that previously contained sub lists, will be split to two msgs.
The first one will be SPICE_MSG_LIST, holding the sub list, and the second will be the
main msg.
When most of the messages do not contain sub lists, the overhead of the additional 10 bytes
for the header of SPICE_MSG_LIST is negligible. In addition, if there is
only one message in the list, it can be sent independently.

Instead of sending the serial number of the messages, the client and
the server will increment local counters upon sending/receiving a
message.
2012-01-12 16:29:01 +02:00
Yonit Halperin
96ffd16e8a enums.h: add SPICE_MSG_LIST
- enums.h was generated from spice.proto
  * as a result SPICE_CHANNEL_USER_DEFINED_START, which was added
    manually, was removed. It is not used yet. If it is going to be used it
    can be added to protocol.h in the future.
- The new msg body is SpiceSubMessageList
2012-01-12 16:26:12 +02:00
Nahum Shalman
fee5c141ab Fix SPICE_STAT_SHM_NAME to be portable
From SHM_OPEN(3):
   For portable use, a shared memory object should be identified by a name
   of the  form  /somename; that is, a null-terminated string of up to
   NAME_MAX (i.e., 255) characters consisting of an initial slash,
   followed by one or more characters, none of which are slashes.
2012-01-08 13:44:20 +02:00
Alon Levy
7fcef3ed30 Release 0.10.0 2011-11-10 18:16:52 +02:00
Alon Levy
05a8178398 autogen.sh: handle ORIGDIR with spaces 2011-11-10 15:46:27 +02:00
Yonit Halperin
dbe61d9320 Release 0.9.1
Cherry-pick of abfdf4d8abf95d003678af5df814f3b1be1fd092 (Release 0.8.2)

semi-seamless migration RHBZ 738262

Conflicts:

	NEWS
	configure.ac
2011-10-02 12:17:47 +02:00
Hans de Goede
b1f84f219f Release 0.9.0 2011-08-25 14:08:41 +02:00
Hans de Goede
80cae9e1e4 NEWS: sync with 0.8 branch 2011-08-25 14:06:03 +02:00
Hans de Goede
72b225b9fc Change usbredir messages to spicevmc messages
While discussing various things with Alon in Vancouver, it came up that
having a channel which simply passes through data coming out of a qemu
chardev frontend unmodified, like the usbredir channel does, can be used
for a lot of other cases too. To facilitate this the usbredir channel code
will be turned into a generic spicevmc channel, which is just a passthrough
to the client, from the spicevmc chardev.

This patch renames the msg types to make clear that they are not usbredir
specific, but instead are generic spicevmc data passthrough messages. The
usbredir channel id is unmodified by this, although the same code and
messages can now be used for multiple purposes, we still need unique ids
for each purpose, so that the client knows how to interpret / represent the
passed through data.

Some examples of why having a generic spicevmc pass through is good:
1) We could add a monitor channel, allowing access to the qemu monitor from
the spice client, since the monitor is a chardev frontend we could re-use
the generic spicevmc channel server code, so all that is needed to add this
(server side) would be reserving a new channel id for this.

2) We could allow users to come up with new channels of their own, without
requiring qemu or server modification. The idea is to allow doing something
like this on the qemu startup cmdline:
-chardev spicevmc,name=generic,channelid=128

To ensure these new "generic" channels cannot conflict with newly added
official types, the must start at the SPICE_CHANNEL_USER_DEFINED_START value
this patch adds (128 or higher).

These new user defined channels could then either be used with a special
modified client, with client plugins (if we add support for those), or
by exporting them on the client side for use by an external ap, see below.

3) We could also add support to the client to make user-defined channels
end in a unix socket / pipe, allowing handling of the data by an external app,
we could for example have a new spice client cmdline argument like this:
--custom-channel unixsocket=/tmp/mysocket,channelid=128

This would allow for something like:
$random app on guest -> virtio-serial -> spicevmc chardev ->
 -> spicevmc channel -> unix socket -> $random app on client

4) On hind sight this could also have been used for the smartcard stuff,
with a 1 channel / reader model, rather then the current multiplexing code
where we've our own multiplexing protocol wrapper over the libcacard
smartcard protocol.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2011-08-25 11:12:34 +02:00
Hans de Goede
7dbb456c36 Add definitions and enums for usbredir channel
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2011-08-13 09:13:21 +02:00
Alon Levy
2d7dde5a3f bump version to 0.8.1 for qxl_dev.h changes 2011-07-17 13:20:53 +03:00
Alon Levy
af687a1457 qxl_dev: add third revision V10
The driver will check for this revision or higher to know that the device
supports async io, the two S3 related ios, and the interrupts IO_CMD and ERROR.
2011-07-17 13:19:48 +03:00
Alon Levy
e80cd6b8f9 qxl_dev: add QXL_INTERRUPT_ERROR
The interrupt is used to notify the guest driver it did an error in
the last io operation. It can be left unhandled.
2011-07-17 13:19:43 +03:00
Alon Levy
fbf2cfb145 add QXL_IO_FLUSH_{SURFACES,RELEASE} for sleep (S3) support
related RHBZ: 688883

Guest initiated sleep looks like this:

 Guest:
  (0) stop putting new commands into the rings
  (1) QXL_IO_FLUSH_SURFACES
      qxl calls flush_surfaces(), spice-server flushes command rings and
      renders all surfaces, thereby flushing state to device memory.
  (2) QXL_IO_DESTROY_ALL_SURFACES
      zap surfaces
  (3) QXL_IO_FLUSH_RELEASE
      push release queue head into the release ring, so the guest
      will see it and can release everything.
  (4) tell acpi to reset
 Qemu:
  (5) qxl_reset_handler
 Guest:
  (6) sends surface create commands

The QXL_IO_FLUSH_SURFACES is an optimization, to reduce vmexits. It is used to
 flush both command rings and update all surfaces at once (equivalent to
 UPDATE_AREA X NUM_ACTIVE_SURFACES)

 destroy all surfaces to release resources but not destroy the guest side surfaces
 get device to flush all server released resources to the release ring (could use multiple
  calls to OOM - but this is not well defined, would need to loop)
 After (1) there will be no memory allocated on the pci bars.
2011-07-17 13:19:36 +03:00
Gerd Hoffmann
7e30df2a8a Add async I/O commands.
Add async versions of the I/O commands which do not block and instead
raise the new QXL_INTERRUPT_IO_CMD when done.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2011-07-17 13:18:15 +03:00
Marc-André Lureau
f4d8de5bdf protocol: add SPICE_{PLAYBACK,RECORD}_CAP_VOLUME caps
These changes the protocol the following way:

When the client announces it has SPICE_PLAYBACK_CAP_VOLUME, the server
can send PlaybackChannel.{volume,mute} messages to notify of volume
changes (respectively for RECORD).

If the client doesn't implement SPICE_PLAYBACK_CAP_VOLUME, the server can
handle the volume changes the way it prefers, for example, ignoring them or
applying volume effect on the server side etc..
2011-06-22 12:01:10 +02:00
Marc-André Lureau
ec027d44b6 spice: enums.h regenerated 2011-06-22 11:55:11 +02:00
Arnon Gilboa
5bb6ff4fa6 macros: define INLINE
needed for spice/common files used by the client, server & qxl driver.
in windows _inline works for both c/c++, while inline is c++ only.
compiling the client with mixed c/c++ code required this define.
2011-05-12 11:45:58 +03:00
Christophe Fergeau
b95f8e77a5 protocol: set version number to 0.8.0
spice-protocol 0.8.0 has been released, but for some reason the
version number in the master branch was still at 0.6.3
2011-04-18 12:48:41 +02:00
Christophe Fergeau
8adf6bcf90 protocol: use packed-start/end to pack structures
spice-protocol comes with 2 headers to handle structure packing,
but controller_prot.h and foreign_menu_prot were both using their
own preprocessor definitions to handle packing. It's better to have
structure packing macros centralized since how it's done varies
between compilers, so it may need to change over time.
2011-04-11 13:01:57 +02:00
Marc-André Lureau
2ffbca2100 controller: add missing spice/types include 2011-04-11 12:44:28 +02:00
Hans de Goede
db3961d831 vd_agent.h: Add a VDP_END_PORT to the chunk port enum 2011-03-24 11:28:51 +01:00
Alon Levy
1a69e2bd75 qxl_dev: introduce defines for rings sizes 2011-03-07 20:46:58 +02:00
Alon Levy
a3b37c6a02 Merge branch 'master' of git://git.freedesktop.org/git/spice/spice-protocol 2011-03-03 11:42:03 +02:00
Marc-André Lureau
6eabd3f5fb protocol: add clipboard selection capability
Add a new capability VD_AGENT_CAP_CLIPBOARD_SELECTION.

When both client and servers have this capability, the
VDAgentClipboard* messages MUST be prepended with a uint8_t indicating
which clipboard selection to operate + 3 bytes stuffing for alignment
that could be used for future capabilities or extensions.

A few clipboard selection are defined according to X11/Gtk scheme:

- VD_AGENT_CLIPBOARD_SELECTION_CLIPBOARD: the default clipboard,
  implemented by most OS to deal with explicit Copy/Paste operations.

- VD_AGENT_CLIPBOARD_SELECTION_PRIMARY: the PRIMARY clipboard, used
  for mouse selections.

- VD_AGENT_CLIPBOARD_SELECTION_SECONDARY: the SECONDARY clipboard.

See also:
http://www.freedesktop.org/wiki/Specifications/ClipboardsWiki

https://bugs.freedesktop.org/show_bug.cgi?id=34833
2011-02-28 14:51:32 +01:00
Marc-André Lureau
7300282977 protocol: add common channel caps for AUTH mechanism selection
Current version 2.0 of the SPICE protocol describes how the client
reply to the server SpiceLinkReply message with a RSA_public_encrypt()
of the password.

Instead of using the current Spice AUTH mechanism, we would like to
offer different AUTH mechanisms, in particular SASL, which is a
framework allowing different underlying mechanisms such as
GSSAPI/Kerberos v5 (and optionally adding a data security layer).

We could bump the protocol version, but that would make this feature
mandatory for the implementer of the protocol. By using the channel
caps, the client and server are left to negotiate and alter the AUTH
part of the protocol as follows:

- SPICE_COMMON_CAP_PROTOCOL_AUTH_SELECTION, if set, the authentication
  mechanism can be chosen during link phase. If both client and server
  have this cap, the client MUST reply to SpiceLinkReply with a
  SpiceLinkAuthMechanism message, with the value of the CAP_AUTH
  mechanism choosen (a uint32 auth_mechanism). The following
  authentication steps are described by the selected authentication
  mechanism.

The differents mechanisms selectable via
SPICE_COMMON_CAP_PROTOCOL_AUTH_SELECTION are also specified as part of
the common channel caps. They can be used only if both client and
server offer them.

Ex: no AUTH selection
C: SpiceLinkMess
S: SpiceLinkReply, CAP_PROTOCOL_AUTH_SELECTION not in common caps
- The client can't choose AUTH, and fallback on Spice RSA mechanism

Ex: AUTH selection
C: SpiceLinkMess, CAP_PROTOCOL_AUTH_SELECTION in common caps
S: SpiceLinkReply, CAP_PROTOCOL_AUTH_SELECTION in common caps
- The client MUST reply with SpiceLinkAuthMechanism
C: SpiceLinkAuthMechanism (with a matching CAP_AUTH)

- SPICE_COMMON_CAP_AUTH_SPICE, the following steps and authentication
  mechanism are the same as with version 2.0: a RSA_public_encrypt()
  of the password is sent.

  This mechanism MUST be implemented in both client and server to
  comply with the SPICE protocol.

- SPICE_COMMON_CAP_AUTH_SASL, the authentication exchange follows
  SASL protocol has defined in RFC 2222.

  This mechanism is OPTIONAL in both client and servers.

Ex: AUTH selection, followed by SASL authentication

AUTH Selection:
C: SpiceLinkMess, CAP_PROTOCOL_AUTH_SELECTION + CAP_AUTH_SASL in common caps
S: SpiceLinkReply, CAP_PROTOCOL_AUTH_SELECTION + CAP_AUTH_SASL in common caps
- The client MUST reply with SpiceLinkAuthMechanism
C: SpiceLinkAuthMechanism CAP_AUTH_SASL

Init:
S:  u32 mechlist-length
    u8-array mechlist-string

Start:
C:  u32 mechname-length
    u8-array mechname-string
    u32 clientout-length
    u8-array clientout-string
S:  u32 serverin-length
    u8-array serverin-string
    u8 continue

Step: (while continue)
C:  u32 clientout-length
    u8-array clientout-string
S:  u32 serverin-length
    u8-array serverin-string
    u8 continue

See also VNC SASL protocol description, which uses the same protocol:

http://sourceforge.net/mailarchive/forum.php?thread_name=20100719125155.GA14166%40evileye.atkac.brq.redhat.com&forum_name=tigervnc-rfbproto

Updated since v1 of this commit:
 - renamed s/SPICE_CHANNEL_CAP/SPICE_COMMON_CAP
 - added some note about mandatory vs optional mechanisms.
2011-02-23 17:55:58 +02:00
Marc-André Lureau
0386da3be4 protocol: add common channel caps for AUTH mechanism selection
Current version 2.0 of the SPICE protocol describes how the client
reply to the server SpiceLinkReply message with a RSA_public_encrypt()
of the password.

Instead of using the current Spice AUTH mechanism, we would like to
offer different AUTH mechanisms, in particular SASL, which is a
framework allowing different underlying mechanisms such as
GSSAPI/Kerberos v5 (and optionally adding a data security layer).

We could bump the protocol version, but that would make this feature
mandatory for the implementer of the protocol. By using the channel
caps, the client and server are left to negotiate and alter the AUTH
part of the protocol as follows:

- SPICE_COMMON_CAP_PROTOCOL_AUTH_SELECTION, if set, the authentication
  mechanism can be chosen during link phase. If both client and server
  have this cap, the client MUST reply to SpiceLinkReply with a
  SpiceLinkAuthMechanism message, with the value of the CAP_AUTH
  mechanism choosen (a uint32 auth_mechanism). The following
  authentication steps are described by the selected authentication
  mechanism.

The differents mechanisms selectable via
SPICE_COMMON_CAP_PROTOCOL_AUTH_SELECTION are also specified as part of
the common channel caps. They can be used only if both client and
server offer them.

Ex: no AUTH selection
C: SpiceLinkMess
S: SpiceLinkReply, CAP_PROTOCOL_AUTH_SELECTION not in common caps
- The client can't choose AUTH, and fallback on Spice RSA mechanism

Ex: AUTH selection
C: SpiceLinkMess, CAP_PROTOCOL_AUTH_SELECTION in common caps
S: SpiceLinkReply, CAP_PROTOCOL_AUTH_SELECTION in common caps
- The client MUST reply with SpiceLinkAuthMechanism
C: SpiceLinkAuthMechanism (with a matching CAP_AUTH)

- SPICE_COMMON_CAP_AUTH_SPICE, the following steps and authentication
  mechanism are the same as with version 2.0: a RSA_public_encrypt()
  of the password is sent.

  This mechanism MUST be implemented in both client and server to
  comply with the SPICE protocol.

- SPICE_COMMON_CAP_AUTH_SASL, the authentication exchange follows
  SASL protocol has defined in RFC 2222.

  This mechanism is OPTIONAL in both client and servers.

Ex: AUTH selection, followed by SASL authentication

AUTH Selection:
C: SpiceLinkMess, CAP_PROTOCOL_AUTH_SELECTION + CAP_AUTH_SASL in common caps
S: SpiceLinkReply, CAP_PROTOCOL_AUTH_SELECTION + CAP_AUTH_SASL in common caps
- The client MUST reply with SpiceLinkAuthMechanism
C: SpiceLinkAuthMechanism CAP_AUTH_SASL

Init:
S:  u32 mechlist-length
    u8-array mechlist-string

Start:
C:  u32 mechname-length
    u8-array mechname-string
    u32 clientout-length
    u8-array clientout-string
S:  u32 serverin-length
    u8-array serverin-string
    u8 continue

Step: (while continue)
C:  u32 clientout-length
    u8-array clientout-string
S:  u32 serverin-length
    u8-array serverin-string
    u8 continue

See also VNC SASL protocol description, which uses the same protocol:

http://sourceforge.net/mailarchive/forum.php?thread_name=20100719125155.GA14166%40evileye.atkac.brq.redhat.com&forum_name=tigervnc-rfbproto

Updated since v1 of this commit:
 - renamed s/SPICE_CHANNEL_CAP/SPICE_COMMON_CAP
 - added some note about mandatory vs optional mechanisms.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2011-02-23 16:50:46 +01:00
Alon Levy
9d5ef9beec enums: typedefy SpiceBitmapFmt 2011-02-10 20:11:11 +02:00
Alon Levy
f5689c14cf qxl_dev.h: make QXLEffectType an enum instead of defines 2011-02-10 15:43:09 +02:00
Alon Levy
07aa808a21 qxl_dev.h: make QXLBitmapFlags a typedef 2011-02-10 15:43:09 +02:00
Alon Levy
6e719d6fcc qxl_dev.h: make QXLSurfaceCmdType a typedef 2011-02-10 15:43:06 +02:00
Alon Levy
3b67b660b6 qxl_dev.h: name QXL_IMAGE_* flags as type and enum QXLImageFlags 2011-02-10 15:43:02 +02:00
Alon Levy
dbe9402bc2 qxl_dev.h: make QXLCmdType enum also a typedef 2011-02-10 15:42:59 +02:00
Arnon Gilboa
d529c7d830 define spice_mb MemoryBarrier for WIN64
__asm is not supported on _WIN64, so use macro instead
required for Windows x64 guest display driver (qxldd.dll)
2011-02-02 11:34:19 +02:00
Hans de Goede
0b953e03ba Update license header for spice/macros.h
This one mistakenly had a GPL header rather then an LGPL header.
2011-01-21 15:39:09 +01:00
Marc-André Lureau
45f954aadb mingw32: specify packing alignment to 1 byte, to override -mms-bitfield
Ex: G_STRUCT_OFFSET(SpiceLinkReply, num_channel_caps) is 172 bytes
when compiled with -mms-bitfield, and 170 bytes without.

GLib/Gtk are compiled with -mms-bitfield, and it is necessary to
compile with the same option for compatibility. The pack pragma
for MINGW32 corrects the structure alignement.

We could use the pack pragma for GNUC unconditionally, that could help
to ensure struct binary compatibility between different compiled
flavours.
2010-12-29 16:13:55 +01:00
Alon Levy
c3822ca59b smartcard: add channel 2010-10-25 14:51:42 +02:00
Hans de Goede
d63c0072b4 controller: Make all text utf-8
We are making all text send over the controller socket utf-8, rather then
having somethings as 8 bit (hostname) and others unicode16.

Adjust the CONTROLLER_MENU_*_DELIMITER defines for this.
2010-10-21 16:47:12 +02:00
Hans de Goede
254b8803f9 Release 0.6.3 2010-10-18 15:10:14 +02:00
Arnon Gilboa
6e499cf69e Add controller protocol 2010-10-18 10:08:45 +02:00
Arnon Gilboa
8e1e17755e Add foreign menu protocol 2010-10-18 10:02:11 +02:00
Hans de Goede
7e66782a76 Add clipboard data types for images 2010-10-12 13:52:40 +02:00
Hans de Goede
55bdae1179 VD_AGENT_CLIPBOARD_GRAB takes a list of types rather then a single type
This way the grabbing side can indicate when the clipboard owning app
can provide the clipboard contents in multiple formats, ie plain text
and html.

Also drop the VD_AGENT_CLIPBOARD_BITMAP type until we have a clear
cross platform definition of the contents to send for bitmap type
clipboard data.
2010-10-04 16:54:00 +02:00
Arnon Gilboa
016cdb0b1d vd_agent: add VD_AGENT_CAP_CLIPBOARD_BY_DEMAND capability enum
VD_AGENT_CLIPBOARD_NONE for unsupported clipboard types
2010-10-04 16:48:27 +02:00
Arnon Gilboa
5fdd0ba665 vd_agent: add protocol messages for clipboard/selection-owner model
-VD_AGENT_CLIPBOARD_GRAB(type) - tell the other side that an application in our side ("we") got ownership of the clipboard.
-VD_AGENT_CLIPBOARD_REQUEST(type) - after we know the other side owns the clipboard (GRAB received), we notify the os we are the owner. when we are asked by the os/app for the clipboard data, we send this REQUEST msg to the other side.
-VD_AGENT_CLIPBOARD(type, data) - the existing message for sending the clipboard, is now sent only in response to REQUEST.
-VD_AGENT_CLIPBOARD_RELEASE - tell the other side that we are no longer the owner of the clipboard (e.g. the owner app was closed).

this patch will be followed by agent & client patches handling the above messages.
2010-10-04 16:48:27 +02:00
Alexander Larsson
57872d7887 Bump version to 0.6.1 2010-09-29 18:16:07 +02:00
Alexander Larsson
2884c98787 Update for release 2010-09-29 18:16:00 +02:00
Gerd Hoffmann
527d52ae25 add compat flag for 16bpp mode
spice 0.6 uses 32bpp values unconditionally for brush and palette
colors.

spice 0.4 used to use 16 bpp or 32 bpp depending on the video mode.
The qxl parser needs to know the guest video mode depth to correctly
interpret these values in spice 0.4 compat mode.  Add a flag to pass
on this informartion.
2010-09-14 10:08:28 +02:00
Alexander Larsson
3eae24f83d Bump version to 0.6.0 2010-08-31 14:28:44 +02:00
Alexander Larsson
068e6362d3 Update NEWS for release 2010-08-31 14:26:39 +02:00
Alon Levy
31d502522a add vd_agent announce capabilities message 2010-08-31 11:08:33 +03:00
Alon Levy
2335032d3b Merge commit 'e27cb334cf70409c7e32be6f061921b4b317be17' 2010-08-30 16:13:58 +03:00
Alon Levy
e27cb334cf move pipe header defines from reds.c to spice-protocol 2010-08-30 13:25:44 +03:00
Alexander Larsson
ae739ac541 Update NEWS for release 2010-08-29 20:17:36 +03:00
Alexander Larsson
5200cb0cd1 Update version to 0.5.3 2010-08-29 20:17:36 +03:00
Alexander Larsson
ca700d1fa7 Change major to 2 to declare network protocol stable 2010-08-29 20:17:36 +03:00
Yonit Halperin
3f63e04881 vdagent protocol: add display setting 2010-08-29 20:17:36 +03:00
Arnon Gilboa
b0f61eba25 client/agent: add clipboard max size limit for sending to/from the guest agent
define default & env variable for overriding it
2010-07-21 17:41:13 +03:00
Alexander Larsson
03498833d7 Update NEWS for release 2010-07-20 18:05:15 +02:00
Alexander Larsson
4f38933a08 Update version to 0.5.3 2010-07-20 18:03:35 +02:00
Alexander Larsson
d8b1b6afb2 Change major to 2 to declare network protocol stable 2010-07-20 15:52:05 +02:00
Yonit Halperin
1509b51bef vdagent protocol: add display setting 2010-07-19 08:34:33 +03:00
Alon Levy
a94a5b171a clipboard agent message added 2010-07-11 12:09:31 +03:00
Alexander Larsson
a9bbc090a5 Update NEWS for release 2010-07-08 20:47:06 +02:00
Alexander Larsson
8ba4939810 Fix misspellings
SpicedSubMessage -> SpiceSubMessage
QXLAlphaBlnd -> QXLAlphaBlend
2010-07-08 18:22:41 +02:00
Gerd Hoffmann
3bc42870d0 place pkgconfig file in /usr/share 2010-07-08 16:59:47 +02:00
Alexander Larsson
4cc9675ef5 Include enums.h from qxl_dev.h
This makes stuff keep building as before when draw.h included enum.h
2010-07-08 15:56:14 +02:00
Alexander Larsson
8deadab956 List all the PCI ids and revisions instead of just the latest/current 2010-07-08 15:16:22 +02:00
Alexander Larsson
a65d4b5d09 Move spice/draw.h to spice 2010-07-08 13:36:40 +02:00
Alexander Larsson
b25441f26b Add QXLCursorHeader and use instead of SpiceCursorHeader in qxl 2010-07-08 13:23:28 +02:00
Alexander Larsson
17b34b0032 Make SpiceLineAttr.style a normal pointer 2010-07-08 12:42:15 +02:00
Alexander Larsson
77927cec02 Use QXLFIXED, not SPICE_FIXED28_4 in qxl_dev.h 2010-07-08 12:41:47 +02:00
Gerd Hoffmann
3f1e240574 qxl abi: Add QXLImage and & co
Also, this changes the SpiceImage types to be more useful
as internal types, with real typed pointers. It also
adds a SpiceChunk iovec type for easy representation of
chunked data.
2010-07-07 22:46:26 +02:00
Alexander Larsson
1d74c91701 Update SpicePath.segments to a pointer array 2010-07-05 20:46:47 +02:00
Gerd Hoffmann
92c6782209 Update SpiceString to use an array of pointers for glyphs 2010-07-02 16:47:28 +02:00
Alexander Larsson
a1262cc611 Don't make SpicePath.segment a SpicePathSeg
The MS compiler doesn't like arrays of structures with an array
of length zero at the end, so we have to manually cast this when
using it.
2010-07-01 16:05:25 +02:00
Alexander Larsson
4cf3b18f62 Simplify SpiceLineAttr by removing unused elements and enums 2010-06-30 16:46:48 +02:00
Alexander Larsson
36126f5ee3 Change SpicePath.size to SpicePath.num_segments
We now track the number of segments rather than the memory size
of the path internally.
2010-06-29 21:26:34 +02:00
Gerd Hoffmann
eb96d4ec74 make SpiceRect compatible with pixman_box32 2010-06-29 16:25:42 +02:00
Gerd Hoffmann
65f9bef4fe qxl abi: zap SPICE_ADDRESS for clip rects and paths. 2010-06-29 13:11:57 +02:00
Gerd Hoffmann
5938ace152 qxl abi: add QXLRect 2010-06-29 12:29:45 +02:00
Gerd Hoffmann
36bdfe2f47 qxl abi: add QXLPoint & friends 2010-06-29 12:29:45 +02:00
Gerd Hoffmann
f433459af1 qxl abi: add QXLClip 2010-06-29 12:29:45 +02:00
Gerd Hoffmann
d0d9c32ed9 qxl abi: add QXLLineAttr 2010-06-29 12:29:45 +02:00
Gerd Hoffmann
900f532cc2 qxl abi: add QXLPattern 2010-06-29 12:29:45 +02:00
Gerd Hoffmann
772fa958a7 qxl abi: add QXLBrush 2010-06-29 12:29:45 +02:00
Gerd Hoffmann
30f1ed5dc6 qxl abi: add QXLQMask 2010-06-29 12:29:45 +02:00
Gerd Hoffmann
faa60f1c6d qxl abi: add QXLBlackness+QXLInvers+QXLWhiteness 2010-06-29 12:29:45 +02:00
Gerd Hoffmann
e4dedcdcc3 qxl abi: add QXLText 2010-06-29 12:29:45 +02:00
Gerd Hoffmann
34d776cebc qxl abi: add QXLStroke 2010-06-29 12:29:45 +02:00
Gerd Hoffmann
7851c98a4f qxl abi: add QXLRop3 2010-06-29 12:29:41 +02:00
Gerd Hoffmann
38a8c668dd qxl abi: add QXLTransparent 2010-06-29 12:29:41 +02:00
Gerd Hoffmann
28b990c0d9 qxl abi: add Copy+Blend.
Add QXLCopy and QXlBlend, also fix tyops (s/rop_decriptor/rop_descriptor/).
2010-06-29 12:29:41 +02:00
Gerd Hoffmann
b64d99aea3 qxl abi: add Opaque.
Add QXLOpaque, also fix tyops (s/rop_decriptor/rop_descriptor/).
2010-06-29 12:29:35 +02:00
Gerd Hoffmann
de94076219 qxl abi: add Fill.
Add QXLFill, also fix tyops (s/rop_decriptor/rop_descriptor/).
2010-06-29 12:29:04 +02:00
Gerd Hoffmann
201ef133fa qxl abi: add AlphaBlnd.
Add QXLAlphaBlnd and QXLCompatAlphaBlnd types.
2010-06-29 12:29:04 +02:00
Alexander Larsson
a5be505ff4 Remove SPICE_CLIP_TYPE_PATH enum.
Clip by path has not been supported since the pixman change, and
the win32 drivers were neutered to never produce it a while ago. Also,
even before that neutering it happened extremely seldom (never seen in
real life).
2010-06-24 14:25:45 +02:00
Alexander Larsson
9837b4596c Reset minor to 0 as we're bumping major 2010-06-23 11:50:26 +02:00
Yonit Halperin
99f2665776 add image type for RGBA bitmaps that were compressed by a combination of JPEG (RGB) and LZ (alpha channel). 2010-06-21 15:13:56 +02:00
Yonit Halperin
63f1c6c01a add image type for images that are compressed by zlib after they have been compressed by glz 2010-06-21 14:55:59 +02:00
Alexander Larsson
1f37a974bf Remove duplicated enums for keyboard modifiers 2010-06-18 16:29:49 +02:00
Alexander Larsson
23850b5fce Move all message structs to spice
We want to make these structures internal so we're free to change them.
The actual on-network ABI is now defined by the spice protocol
description rather than the c structures anyway.
2010-06-18 14:04:37 +02:00
Alexander Larsson
8a13061677 Move all enums and flags to generated header file 2010-06-18 13:21:59 +02:00
Alexander Larsson
d58376dc57 Add some types needed by the demarshalling work 2010-06-14 15:42:29 +02:00
Yonit Halperin
ed14a2ab2e cache support for replacing images that were compressed using jpeg with lossless images 2010-06-09 11:21:22 +02:00
Yonit Halperin
ace7d06a7b add image type for jpeg 2010-06-09 11:21:22 +02:00
Alexander Larsson
9e73c41877 Fix some misspelled identifiers
severty -> severity
SpiceResorceID -> SpiceResourceID
SpiceResorceList -> SpiceResourceList
resorces -> resources
ped_size -> pad_size
postition -> position
2010-05-21 11:09:22 +02:00
Alexander Larsson
55b440f9c4 Add byteswapping macros 2010-05-19 16:02:40 +02:00
Gerd Hoffmann
73b175849c add QXL_SURF_FLAG_KEEP_DATA 2010-05-18 17:26:47 +02:00
Alexander Larsson
b07c09ca17 Add image flag for "all high bits are set to one"
This lets us send rgba images with all high bytes 0xff as rgb, which
is not all that uncommon.
2010-04-28 15:40:12 +02:00
Gerd Hoffmann
445a96d029 make unstable qxl compatible with 0.4 qxl
Add SET_MODE IO port back in.
Add QXLRom offset fields back in.

I/O ports, RAM and ROM layout are binary compatible now.

With these changes merged it should be possible to create *one* qxl
device which supports *both* 0.4 and unstable spice commands.

Everything the guest touches before entering native mode is binary
compatible.  Old (0.4) guests drivers enter native mode via SET_MODE,
new (unstqable) guest drivers enter native mode using CREATE_PRIMARY,
so when we see spice commands from the guest come in we know
whenever we have to interpret them as 0.4 or unstable ones.

Added commends to structs which need care wrt. compatibility when
updating.

Added some QXLCompat* structs for the 0.4 struct versions.

Added a flags field to QXLCommandEx so qxl can signal whenever commands
are compat or not.

Moved QXLRom->n_surfaces to make QXLRom->flags 64bit aligned.

Add padding to QXLRom to ensure future elements are 32bit aligned.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
2010-04-26 15:48:54 +02:00
Alexander Larsson
797d4c1ca8 Add source/dest alpha information to AlphaBlend 2010-04-23 11:07:27 +02:00
Alexander Larsson
916f3818d8 Pass format when creating surfaces rather than depth 2010-04-19 15:47:48 +02:00
Alexander Larsson
8ef80db4ac Add some comment describing the bitmap formats 2010-04-19 15:47:43 +02:00
Alexander Larsson
32541ac871 Add surface type enum
This is used to specify how pixels map to colors in surfaces.
2010-04-19 15:46:10 +02:00
Alexander Larsson
f50ca498cc Make pci id be 0x1ff rev 1, for unstable work
We will switch back to 0x101 when things settle down and we guarantee
backwards compatibility. For now we will keep breaking it, bumping
revision each time this happens.
2010-04-06 12:29:52 +02:00
Izik Eidus
98fd8921a9 spice-protocol off screens supports
Signed-off-by: Izik Eidus <ieidus@redhat.com>
2010-04-03 05:41:20 +03:00
Izik Eidus
14db228e81 spice-protocl: add spice_msg_display_surface_create/destroy
protocol commands to create/destroy surface on the client.

i removed spice_msg_display_mode as it now not needed

Signed-off-by: Izik Eidus <ieidus@redhat.com>
2010-04-03 05:40:50 +03:00
Alexander Larsson
d9f01c38ee Bump minor to 3
There is some confusion in the different branches on what the minors
mean. We expect minor == 2 to mean support for
SPICE_MSG_MAIN_MIGRATE_SWITCH_HOST and SpiceMsgMainMigrationBegin
with added public key info. All other additions like tunneling are
for minor 3 (although we might not do a release with minor 3, but
rather the bump major).
2010-03-24 16:11:59 +01:00
Alexander Larsson
a668cb38e2 Add SPICE_MSG_MAIN_MIGRATE_SWITCH_HOST message
This is a simpler form of migration
2010-03-24 16:11:59 +01:00
Alexander Larsson
6314aee92d Use int32, not int in protocol defining structure
"int" is not of a welldefined size, fortunally all existing uses
are 32bit.
2010-03-22 20:25:48 +01:00
Alexander Larsson
cac2bc7984 Add a bunch of generically useful macros
This is largely based on gmacros.h from glib with a few
custom macros that were repeated in the spice codebase.
2010-03-09 11:53:59 +01:00
Alexander Larsson
df85c9d314 Disable warning about our use of pragma pack in include file
Without this we can't build the driver
2010-03-05 16:25:05 +01:00
Alexander Larsson
60178205ad Add includes.sed file to handle include renaming 2010-02-04 18:12:07 +01:00
Alexander Larsson
b49e090269 fix up reames 2010-02-04 18:11:09 +01:00
Alexander Larsson
15359ed269 Fix up SPICE_SPICE typo 2010-02-04 18:10:50 +01:00
Alexander Larsson
fa94dbba3f Add gitignore file 2010-02-04 16:47:32 +01:00
Alexander Larsson
193c54c0da Add autoconf and pkg-config setup 2010-02-04 16:47:27 +01:00
Alexander Larsson
e625b1a1fb Always include using <spice/foo.h> style 2010-02-04 16:47:23 +01:00
Alexander Larsson
966d67a251 Hide internal macros with _SPICE prefix 2010-02-04 16:47:19 +01:00
Alexander Larsson
49fccfefc8 Clean up and standardize header guards 2010-02-04 16:47:14 +01:00
Alexander Larsson
430b3b036d Clean up header names, removing references to "red"
red_error_codes.h -> spice/error_codes.h
 red.h -> spice/protocol.h
 reds_stat.h -> spice/stats.h
2010-02-04 16:47:07 +01:00
Alexander Larsson
90352580a0 Rename all identifiers
This is just the result of running:
./rename-identifiers.sh renames spice/*.h
2010-02-04 16:46:27 +01:00
Alexander Larsson
b0188a46d1 Clean up all network protocol names to start with Spice/SPICE_
This makes use have a consistent namespace for the core network protocol.
The PCI devices each have their own namespaces.
2010-02-04 16:43:24 +01:00
Alexander Larsson
cb5909696b Add utility script to do C identifier renaming 2010-02-04 16:43:24 +01:00
Alexander Larsson
9032d5235b Use <spice/barrier.h> memory barrier 2010-02-04 16:43:24 +01:00
Alexander Larsson
590e21bc57 Add standard memory barrier header 2010-02-04 16:43:24 +01:00
Alexander Larsson
7050ae14a4 Add standard header for structure packing 2010-02-04 16:43:15 +01:00
Alexander Larsson
c2852f6b5f Use spice/types.h and its types
There is a standard for integer types (i.e. uint32_t) which we're using
at some places, but not others. Lets use it everywhere.
2010-02-04 16:40:42 +01:00
Alexander Larsson
a5d25ea987 Add standard header for defining core types
Initially we only do what is necessary to get the stdint types like
uint32_t, etc.
2010-02-04 16:23:31 +01:00
Alexander Larsson
3988329f11 Add MIT style COPYING file 2010-02-04 16:23:24 +01:00
Alexander Larsson
e0f9912933 Import all protocol headers from spice/common 2010-02-04 16:18:44 +01:00
12 changed files with 13 additions and 118 deletions

View File

@ -1,11 +1,3 @@
Major changes in 0.14.3
=======================
* Add VD_AGENT_CLIPBOARD_FILE_LIST to support copy/paste of files with
WebDAV support
* Add support for side mouse buttons
* Add a MonitorsMM field to VDAgentMonitorsConfig allowing to pass
physical monitor dimension
Major changes in 0.14.2
=======================
* Removed Autoconf support, only Meson is available

33
debian/changelog vendored
View File

@ -1,36 +1,3 @@
spice-protocol (0.14.3-2) unstable; urgency=medium
Add support for AV1 codec [amf vaapi qsv nvenc]
Add support for H265 codec [amf vaapi qsv nvenc]
Add support for H264 codec [amf vaapi qsv nvenc]
Add support for MJPEG codec [vaapi nvjpg]
-- Lierfang Support Team <itsupport@lierfang.com> Fri, 21 May 2025 15:45:00 +0300
spice-protocol (0.14.3-1) unstable; urgency=medium
* New upstream version 0.14.3 (Closes: #976333)
* d/watch: allow .xz extension too (upstream switched to it at 0.14.3)
* use meson to build spice-protocol (add it to Build-Depends)
* remove references to removed files from d/copyright
(spice/controller_prot.h spice/foreign_menu_prot.h)
* hack: remove arch-specific but unused libdir= assignment
in generated spice-protocol.pc
-- Michael Tokarev <mjt@tls.msk.ru> Fri, 04 Dec 2020 15:45:00 +0300
spice-protocol (0.14.1-2) unstable; urgency=medium
[ Laurent Bigonville ]
* debian/docs: Install the README.md and CHANGELOG.md files
[ Michael Tokarev ]
* set Maintainer to the QEMU team (Closes: #911429)
* set VCS links to point to qemu-team on salsa
* use secure (https) URLs in d/control & d/copyright
-- Michael Tokarev <mjt@tls.msk.ru> Thu, 23 Jul 2020 15:22:04 +0300
spice-protocol (0.14.1-1) unstable; urgency=medium
* Team upload.

8
debian/control vendored
View File

@ -2,12 +2,12 @@ Source: spice-protocol
Priority: optional
Maintainer: Debian QEMU Team <pkg-qemu-devel@lists.alioth.debian.org>
Uploaders: Michael Tokarev <mjt@tls.msk.ru>
Build-Depends: debhelper-compat (= 12), meson
Build-Depends: debhelper-compat (= 12)
Standards-Version: 4.5.0
Section: libs
Homepage: https://www.spice-space.org/
Vcs-Git: https://salsa.debian.org/qemu-team/spice-protocol.git
Vcs-Browser: https://salsa.debian.org/qemu-team/spice-protocol
Homepage: http://www.spice-space.org/
Vcs-Git: https://salsa.debian.org/debian/spice-protocol.git
Vcs-Browser: https://salsa.debian.org/debian/spice-protocol
Package: libspice-protocol-dev
Section: libdevel

4
debian/copyright vendored
View File

@ -6,7 +6,7 @@ Upstream-Contact: Alexander Larsson <alexl@redhat.com>,
Gerd Hoffmann <kraxel@redhat.com>,
Izik Eidus <ieidus@redhat.com>,
Yonit Halperin <yhalperi@redhat.com>
Source: https://www.spice-space.org/download/releases/
Source: http://www.spice-space.org/download/releases/
Files: *
Copyright: Copyright (C) 2009-2013 Red Hat, Inc
@ -39,6 +39,8 @@ License: BSD-3-clause
Files: spice/macros.h
spice/controller_prot.h
spice/foreign_menu_prot.h
debian/*
Copyright: Copyright (C) 2009-2010 Red Hat, Inc
Copyright (C) 2010 Liang Guo <bluestonechina@gmail.com>

2
debian/docs vendored
View File

@ -1,2 +0,0 @@
README.md
CHANGELOG.md

6
debian/rules vendored
View File

@ -5,9 +5,3 @@
%:
dh $@
# meson-generated spice-protocol.pc contains libdir= assignment
# which is not used but causes lintian to emit error condition
override_dh_auto_build:
dh_auto_build
sed -i '/^libdir=/D' obj-*/meson-private/spice-protocol.pc

2
debian/watch vendored
View File

@ -1,3 +1,3 @@
version=4
opts=pgpsigurlmangle=s/$/.sig/ \
https://www.spice-space.org/download/releases/spice-protocol-(\d+\.\d*[02468]\.\d+)\.tar\.(bz2|xz)
https://www.spice-space.org/download/releases/spice-protocol-(\d+\.\d*[02468]\.\d+)\.tar\.(?:gz|bz2|xz)

View File

@ -2,7 +2,7 @@
# project definition
#
project('spice-protocol',
version : '0.14.3',
version : '0.14.2',
license : 'BSD',
meson_version : '>= 0.41.0')

View File

@ -1,5 +1,5 @@
Name: spice-protocol
Version: 0.14.3
Version: 0.14.2
Release: 1%{?dist}
Summary: Spice protocol header files
Group: Development/Libraries
@ -44,8 +44,7 @@ Requires: mingw64-pkg-config
%install
%meson_install
export DESTDIR=%{buildroot}
%mingw_ninja install
%mingw_ninja_install
%files

View File

@ -146,24 +146,11 @@ typedef enum SpicePathFlags {
typedef enum SpiceVideoCodecType {
SPICE_VIDEO_CODEC_TYPE_MJPEG = 1,
SPICE_VIDEO_CODEC_TYPE_MJPEG_NVJPG,
SPICE_VIDEO_CODEC_TYPE_MJPEG_VAAPI,
SPICE_VIDEO_CODEC_TYPE_VP8,
SPICE_VIDEO_CODEC_TYPE_H264,
SPICE_VIDEO_CODEC_TYPE_H264_NVENC,
SPICE_VIDEO_CODEC_TYPE_H264_AMF,
SPICE_VIDEO_CODEC_TYPE_H264_QSV,
SPICE_VIDEO_CODEC_TYPE_H264_VAAPI,
SPICE_VIDEO_CODEC_TYPE_VP9,
SPICE_VIDEO_CODEC_TYPE_H265,
SPICE_VIDEO_CODEC_TYPE_H265_NVENC,
SPICE_VIDEO_CODEC_TYPE_H265_AMF,
SPICE_VIDEO_CODEC_TYPE_H265_QSV,
SPICE_VIDEO_CODEC_TYPE_H265_VAAPI,
SPICE_VIDEO_CODEC_TYPE_AV1_NVENC,
SPICE_VIDEO_CODEC_TYPE_AV1_AMF,
SPICE_VIDEO_CODEC_TYPE_AV1_QSV,
SPICE_VIDEO_CODEC_TYPE_AV1_VAAPI,
SPICE_VIDEO_CODEC_TYPE_ENUM_END
} SpiceVideoCodecType;
@ -349,8 +336,6 @@ typedef enum SpiceMouseButton {
SPICE_MOUSE_BUTTON_RIGHT,
SPICE_MOUSE_BUTTON_UP,
SPICE_MOUSE_BUTTON_DOWN,
SPICE_MOUSE_BUTTON_SIDE,
SPICE_MOUSE_BUTTON_EXTRA,
SPICE_MOUSE_BUTTON_ENUM_END
} SpiceMouseButton;
@ -359,12 +344,8 @@ typedef enum SpiceMouseButtonMask {
SPICE_MOUSE_BUTTON_MASK_LEFT = (1 << 0),
SPICE_MOUSE_BUTTON_MASK_MIDDLE = (1 << 1),
SPICE_MOUSE_BUTTON_MASK_RIGHT = (1 << 2),
SPICE_MOUSE_BUTTON_MASK_UP = (1 << 3),
SPICE_MOUSE_BUTTON_MASK_DOWN = (1 << 4),
SPICE_MOUSE_BUTTON_MASK_SIDE = (1 << 5),
SPICE_MOUSE_BUTTON_MASK_EXTRA = (1 << 6),
SPICE_MOUSE_BUTTON_MASK_MASK = 0x7F
SPICE_MOUSE_BUTTON_MASK_MASK = 0x7
} SpiceMouseButtonMask;
typedef enum SpiceCursorType {

View File

@ -145,25 +145,11 @@ enum {
SPICE_DISPLAY_CAP_GL_SCANOUT,
SPICE_DISPLAY_CAP_MULTI_CODEC,
SPICE_DISPLAY_CAP_CODEC_MJPEG,
SPICE_DISPLAY_CAP_CODEC_MJPEG_NVJPG,
SPICE_DISPLAY_CAP_CODEC_MJPEG_VAAPI,
SPICE_DISPLAY_CAP_CODEC_VP8,
SPICE_DISPLAY_CAP_CODEC_H264,
SPICE_DISPLAY_CAP_CODEC_H264_NVENC,
SPICE_DISPLAY_CAP_CODEC_H264_AMF,
SPICE_DISPLAY_CAP_CODEC_H264_QSV,
SPICE_DISPLAY_CAP_CODEC_H264_VAAPI,
SPICE_DISPLAY_CAP_PREF_VIDEO_CODEC_TYPE,
SPICE_DISPLAY_CAP_CODEC_VP9,
SPICE_DISPLAY_CAP_CODEC_H265,
SPICE_DISPLAY_CAP_CODEC_H265_NVENC,
SPICE_DISPLAY_CAP_CODEC_H265_AMF,
SPICE_DISPLAY_CAP_CODEC_H265_QSV,
SPICE_DISPLAY_CAP_CODEC_H265_VAAPI,
SPICE_DISPLAY_CAP_CODEC_AV1_NVENC,
SPICE_DISPLAY_CAP_CODEC_AV1_AMF,
SPICE_DISPLAY_CAP_CODEC_AV1_QSV,
SPICE_DISPLAY_CAP_CODEC_AV1_VAAPI,
};
enum {

View File

@ -205,30 +205,14 @@ typedef struct SPICE_ATTR_PACKED VDAgentMonConfig {
enum {
VD_AGENT_CONFIG_MONITORS_FLAG_USE_POS = (1 << 0),
VD_AGENT_CONFIG_MONITORS_FLAG_PHYSICAL_SIZE = (1 << 1),
};
typedef struct SPICE_ATTR_PACKED VDAgentMonitorsConfig {
uint32_t num_of_monitors;
uint32_t flags;
VDAgentMonConfig monitors[0];
/* only sent if the FLAG_PHYSICAL_SIZE is present: */
/* VDAgentMonitorMM physical_sizes[0]; */
} VDAgentMonitorsConfig;
/* Physical size of the monitor in millimeters.
* Having this information, the remote/guest display can configure itself with
* appropriate font & scaling to maintain readability. */
typedef struct SPICE_ATTR_PACKED VDAgentMonitorMM {
/*
* Note a width and height of 0 can be used to indicate a disabled
* monitor or no size information is present.
*/
uint16_t height;
uint16_t width;
} VDAgentMonitorMM;
enum {
VD_AGENT_DISPLAY_CONFIG_FLAG_DISABLE_WALLPAPER = (1 << 0),
VD_AGENT_DISPLAY_CONFIG_FLAG_DISABLE_FONT_SMOOTH = (1 << 1),
@ -246,8 +230,6 @@ typedef struct SPICE_ATTR_PACKED VDAgentDisplayConfig {
#define VD_AGENT_RBUTTON_MASK (1 << 3)
#define VD_AGENT_UBUTTON_MASK (1 << 4)
#define VD_AGENT_DBUTTON_MASK (1 << 5)
#define VD_AGENT_SBUTTON_MASK (1 << 6)
#define VD_AGENT_EBUTTON_MASK (1 << 7)
typedef struct SPICE_ATTR_PACKED VDAgentMouseState {
uint32_t x;
@ -282,12 +264,6 @@ enum {
VD_AGENT_CLIPBOARD_IMAGE_BMP, /* optional */
VD_AGENT_CLIPBOARD_IMAGE_TIFF, /* optional */
VD_AGENT_CLIPBOARD_IMAGE_JPG, /* optional */
/* identifies a list of absolute paths in phodav server
* that is associated with the "org.spice-space.webdav.0" webdav channel;
* the items are encoded in UTF-8 and separated by '\0';
* the first item must be either "copy" or "cut" (without the quotes)
* to indicate what action should be performed with the files that follow */
VD_AGENT_CLIPBOARD_FILE_LIST,
};
enum {