Compare commits

...

419 Commits

Author SHA1 Message Date
Michael Scherle
d72466053e added upsampling variants 2025-05-12 11:49:11 +02:00
Michael Scherle
1c6ea5851b added support for AV1 and 4:4:4 support for Vp9, h264, h265 and AV1 2025-05-12 11:49:02 +02:00
Marc-André Lureau
c5c2f26422 Release v0.14.5
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2025-04-30 11:28:57 +04:00
correctmost
3a9e3668f1 build-sys: Fix build error when sanitizers are enabled
Re-running 'meson setup' with sanitizer flags caused the following
error: 'ERROR: Unknown options: "b_lundef, b_sanitize"'

This is a workaround for an upstream Meson issue:
https://github.com/mesonbuild/meson/issues/13651

Signed-off-by: correctmost <126085-correctmost@users.noreply.gitlab.freedesktop.org>
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2025-04-02 06:39:27 +01:00
Qiang Yu
2117405f95 Add enum for gl scanout2 message
This message is a replacement for the original gl scanout
message which does not support multi plane and modifier.

Signed-off-by: Qiang Yu <yuq825@gmail.com>
2025-03-23 20:54:09 +08:00
Akihiko Odaki
c92b54a55f Define SPICE_ENDIAN for MSVC Arm64
It is necessary to build for Windows Arm64.

Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
2025-03-01 01:05:37 +09:00
Victor Toso
4f31c18536 build-sys: post-release version bump 0.14.5
Signed-off-by: Victor Toso <victortoso@redhat.com>
2022-02-10 12:13:32 +01:00
Victor Toso
6f453a775d Release 0.14.4
Signed-off-by: Victor Toso <victortoso@redhat.com>
2022-02-07 13:14:43 +00:00
Frediano Ziglio
7aaa521361 ci: Remove invalid option from rpmlint
The "-o" option is not accepted anymore by rpmlint on newer Fedora.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2022-02-07 12:44:14 +00:00
Stefan Weil
969baca93e stream-device: Fix some typos in comments (found by codespell)
Signed-off-by: Stefan Weil <sw@weilnetz.de>
2021-04-09 19:03:59 +02:00
Frediano Ziglio
06aa9375ad Add some notes on how to prepare a release
That's what I did for last release.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Jakub Janků <jjanku@redhat.com>
2021-01-19 13:23:49 +00:00
Frediano Ziglio
ce0c4211e6 protocol: Fix enumeration deprecation for Visual Studio
Deprecation on enumeration items is not supported by Microsoft
compiler.
Define and use SPICE_GNUC_DEPRECATED_ENUMERATOR.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
2020-11-04 12:14:48 +00:00
Frediano Ziglio
3c4309a517 build-sys: post-release version bump to 0.14.4
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
2020-10-01 09:49:11 +01:00
Frediano Ziglio
90b57dace4 Release 0.14.3
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2020-10-01 09:20:21 +01:00
Marc-André Lureau
6918bacfe5 vdagent: add a MonitorsMM field to VDAgentMonitorsConfig
Allow to update the physcial dimensions of the monitors,
only sent if the flag PHYSICAL_SIZE is present.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-09-14 09:41:01 +01:00
SimonP
cbe7b2c285 protocol: Add support for side mouse buttons
Side mouse buttons currently do not exist in the protocol, causing them
to be inexplicably ignored by VMs in virt-manager and such. This lays
the groundwork for fixing that issue.

Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-08-19 15:11:38 +01:00
Frediano Ziglio
11af68a513 build: Do not use mingw_ninja_install macro in spec file
Some distribution like RHEL 8 does not define this macro.
Use mingw_ninja instead.

Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Uri Lublin <uril@redhat.com>
2020-08-10 09:52:07 +01:00
Jakub Janků
7689b6922b vdagent: add VD_AGENT_CLIPBOARD_FILE_LIST
Signed-off-by: Jakub Janků <jjanku@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-07-08 15:47:41 +01:00
Jakub Janků
55ff87d93c build-sys: post-release version bump to 0.14.3
Signed-off-by: Jakub Janků <jjanku@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-07-08 13:29:33 +01:00
Frediano Ziglio
959717a3a2 Release 0.14.2
Signed-off-by: Frediano Ziglio <freddy77@gmail.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2020-05-15 15:17:17 +01:00
Frediano Ziglio
dcf21aafb9 vd_agent: Add some documentation
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2020-05-15 14:32:40 +01:00
Victor Toso
5ab1474cb5 Formally deprecated celt 0.5.1 usage
Quoting git log from spice-common 72b0d60 "build: Disable celt 0.5.1
by default" in 2018-06-05 [0]

  |  build: Disable celt 0.5.1 by default
  |
  |  This version of the CELT codec has long been obsolete, and
  |  Opus support has been added nearly 5 years ago. It's time
  |  we move on and try to stop using Celt ;)
  |  This commit disables CELT by default, but since
  |  this could be an unexpected change for packagers, if CELT
  |  0.5.1 development headers are installed, it will error
  |  out unless --enable-celt051/--disable-celt051 has
  |  been explicitly specified.

[0] https://gitlab.freedesktop.org/spice/spice-common/commit/72b0d60

This change is part of spice server since f5785db1 or v0.14.1 and
spice-gtk e6e9d7a or v0.35.

It is time to formally deprecated it and remove from all  components
in favor of opus mode.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-04-07 10:31:57 +01:00
Kevin Pouget
896aacee50 enums: add quality_indicator messages
These messages are used to exchange Streaming Quality messages between
SPICE client and SPICE server:

- `SPICE_MSGC_MAIN_QUALITY_INDICATOR`: a client->server message on the
  Main channel. This message is used by the client to share streaming
  quality observation with the server and the adaptive streaming
  control center. The format of the string message is not specified
  yet, it will depend of the sender/receiver final implementation.

- `SPICE_MSG_DISPLAY_QUALITY_INDICATOR`: a server->client message on
  the Display channel. This message is used to inform the client about
  adaptive-streaming specific details. The client should use it to
  configure its quality-message generation algorithms. The format of
  the string message is not specified yet, it will depend of the
  sender/receiver final implementation.

As an example, a `SPICE_MSG_DISPLAY_QUALITY_INDICATOR` message can
inform the client about the requested framerate (say, 60 FPS); and the
client will send a `SPICE_MSGC_MAIN_QUALITY_INDICATOR` warning message
when the measured framerate drops below 45 FPS.

Signed-off-by: Kevin Pouget <kpouget@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-04-02 13:34:35 +01:00
Frediano Ziglio
2d3324b899 vd_agent: Fix incompatibility with Microsoft compiler
Do not nest a zero-size array in another zero size array.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Marek Kedzierski <mkedzier@redhat.com>
2020-04-01 12:24:57 +01:00
Frediano Ziglio
edd2bb7143 vd_agent: Add some documentation
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2020-03-26 09:31:02 +00:00
Frediano Ziglio
0ceb92087e vd_agent: Fix indentation
Use 4 spaces, not 3.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-03-20 08:55:13 +00:00
Frediano Ziglio
dfc27e60d7 vd_agent: Add structure for VD_AGENT_FILE_XFER_STATUS_NOT_ENOUGH_SPACE details
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2020-03-19 14:36:05 +00:00
Frediano Ziglio
f224422c0d vd_agent: Add a new detail for VD_AGENT_FILE_XFER_STATUS_ERROR status
This will allow the agent to send back a more detailed error code.
More comments on header file.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2020-03-19 14:35:58 +00:00
Frediano Ziglio
f79ad62a6d build-sys: Allows spec file to build MingW packages
Add MingW support. This allows to build MingW packages easily with a

  $ rpmbuild -ta spice-protocol-XXXX.tar.xz

This is base on some work by Eduardo Lima adding MingW support to SPEC
files.
Part of dependencies, description and names came from Fedora SPEC file
for mingw-spice-protocol package.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2020-03-12 15:14:42 +00:00
Victor Toso
b0891e4c79 Remove foreign-menu and controller interfaces
Both were formally deprecated and announced for 0.14.1 release and can
be removed from the codebase.

    4816ae5 "foreign-menu: mark as deprecated" in 2020-03-06
    2981f21 "controller: mark as deprecated" in 2020-03-06

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-03-10 16:07:48 +00:00
Frediano Ziglio
e3dcbcb72f Package SPEC file into Meson distribution file
Put final SPEC file in GIT repository directly to avoid having
to bump Meson version to use distribution script. To avoid
having incoherent version numbers check the versions from CI.
Remove 'c' as project language, project don't need to compile
any files.
Meson however needs C compiler even if is not used so add to package
requirements.
Update CI to build RPM from package directly.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2020-03-09 19:00:42 +00:00
Eduardo Lima (Etrunko)
33946522aa Remove autotools files in favor of meson
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-03-09 19:00:36 +00:00
Eduardo Lima (Etrunko)
bbad3fb944 Update spec file and ci script to use meson as default
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-03-09 19:00:28 +00:00
Frediano Ziglio
0724605efc build-sys: post-release version bump 0.14.2
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-03-09 10:35:54 +00:00
Victor Toso
e0ec178a72 Release 0.14.1
Signed-off-by: Victor Toso <victortoso@redhat.com>
2020-03-06 17:05:07 +01:00
Frediano Ziglio
47c931ce2f build: Fix typo in SPEC file name
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2020-03-06 13:45:38 +00:00
Victor Toso
4816ae58d2 foreign-menu: mark as deprecated
This patch deprecates this interface and suggests to drop it in the
next release.

I don't know any user for this interface in the past 5 years. Spice
clients like remote-viewer do use oVirt API for foreign menu.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-03-06 10:46:00 +00:00
Victor Toso
2981f214d3 controller: mark as deprecated
This patch deprecates this interface and suggests to drop it in the
next release.

The last known user of this interface was spice-gtk, which dropped its
implementation in 2017-08-01 with

    spice-gtk@8da3378f "build-sys: remove the spice-controller library"

The commit log there has good enough justification to also drop this
in the protocol.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-03-06 10:45:55 +00:00
Marc-André Lureau
045a6978d6 vdagent: introduce VD_AGENT_CAP_CLIPBOARD_GRAB_SERIAL
When this capability is negoticated by both the client & the agent,
the clipboard grab messages have an associated serial counter.

The serial is reset to 0 upon client connection.

The counter is increment by 1 on each grab message, by both sides.

The sender of the message with the highest serial should be the
clipboard grab owner, and the current session serial should be
updated.

If a lower serial than the current session serial is received, the
grab should be discarded.

Whenever two grabs share the same serial, the one coming from the
client should have a higher priority and the client should gain the
clipboard ownership.

No special treatement is done for the unlikely case of overflowing the
counter. It may temporarily inverse the priority, until both side have
overflown and/or synchronized.

Note: this mechanism isn't aiming at making "the most recent" (as in
time) side gaining the ownership. One side sending subsequent grab
messages earlier will likely take the ownership over a side sending a
single message simultaneously the other way. It only clears the
situation where both side believe that the other is the current
clipboard owner, by having a global ordering and priority in case of
serial conflict.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2020-03-06 09:24:31 +01:00
Marc-André Lureau
4f397d695d vdagent: introduce VD_AGENT_CAP_CLIPBOARD_NO_RELEASE_ON_REGRAB
This capability means the peer will not send a release event between
two subsequent grabs. This helps with interaction issues with
clipboard managers which can be worked around by time-based filters at
this point. With this capability, there is no need for such filter.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2020-03-06 09:24:26 +01:00
Eduardo Lima (Etrunko)
08a3c23407 meson: generate spice-protocol.spec
Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-03-04 12:35:35 +00:00
Victor Toso
faed1bf410 vdi_dev: remove deprecated header
Deprecated since 2d7bf3e "vdi-dev: mark as deprecated" in 2014-12-04
and version 0.12.8.

Signed-off-by: Victor Toso <victortoso@redhat.com>
2020-03-02 18:23:16 +01:00
Victor Toso
1366a78cac vd_agent: remove VD_AGENT_CLIPBOARD_MAX_SIZE_[DEFAULT ENV]
Not used since fc1e7e "Mark VD_AGENT_CLIPBOARD_MAX as deprecated" in
2013-11-14, release v0.12.7

Signed-off-by: Victor Toso <victortoso@redhat.com>
2020-03-02 18:15:24 +01:00
Marc-André Lureau
01f49a97bd Add a .gitpublish
Set a default profile for git-publish.
(https://github.com/stefanha/git-publish)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2020-02-29 13:22:26 +00:00
Kevin Pouget
96d7dd9eef stream-device: Define Quality Indicator messages
These messages are used to transmit streaming quality indicators from
the streaming device to SPICE Server.

The message is a variable-length, zero-terminated string.

A new capability is introduced (STREAM_CAP_QUALITY_INDICATOR) for
SPICE server and streaming agent capabilities negotiation.

Signed-off-by: Kevin Pouget <kpouget@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-11-08 14:35:48 +00:00
Kevin Pouget
8ee9c7822c protocol: Define an enumeration for Quality Indicator messages
These messages are used to transmit streaming quality indicators from
SPICE client to SPICE server.

The message data structure is defined in spice-common/spice.proto:

    message {
        Data data @to_ptr;
    } @declare quality_indicator;

Signed-off-by: Kevin Pouget <kpouget@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-11-08 14:35:44 +00:00
Denis Ollier
dbbe765a7e build-sys: remove codegen leftovers
Codegen has been removed since v0.12.11 (commit 2a6e51c7), no python
modules are used anymore by spice-protocol.

Signed-off-by: Denis Ollier <dollierp@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-11-04 15:48:26 +00:00
Frediano Ziglio
18c9917a71 build-sys: Provide spec file during build
Having the RPM spec file produced by the build is helpful in
different situation. Different tools like mock or code
scanners accept source RPMs as input.
Providing this file allows easily build of the source RPM (and
binaries) using a simple command like

  $ rpmbuild -ta spice-protocol-XXXX.tar.bz2

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2019-10-23 12:58:06 +01:00
Frediano Ziglio
21b06e6585 build-sys: Update URL in SPEC file
Use https instead of http, web server automatically redirects
to secure version.
Remove slash at the end, not needed.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2019-10-23 12:58:03 +01:00
Frediano Ziglio
fe0df3c546 build-sys: Import spec file from Fedora
Will be used by next commits.
The SPEC file will allow to an RPM from sources with a simple
rpmbuild command.
Package files are useful for easy deployment.
This will also be used to provide automatic package build.
This commit just contain a verbatim copy of upstream SPEC file
to make easier to see changes to it and have a start point.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2019-10-23 12:57:57 +01:00
Frediano Ziglio
7d28c75ba6 qxl_dev: Add comment to QXLQUICData->data field
Recently a bug using this structure was fixed.
The bug involved understand the usage of this field so add some
note on the field for future reference.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-08-22 13:30:26 +01:00
Francois Gouget
22f1b1297b protocol: Add some comments to vd_agentd.h
Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
2019-08-07 10:39:45 +01:00
Frediano Ziglio
81f56cf07a start-packet: Correct misleading comment
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Snir Sheriber <ssheribe@redhat.com>
2019-07-21 13:57:37 +01:00
Frediano Ziglio
2d34651f40 qxl_dev: Move QXLReleaseInfoExt out of start/end-packed.h
This structure is not declares as SPICE_ATTR_PACKED resulting it
as aligned and no packed using GCC (no MingW).
This structure is only packed under MingW or Microsoft compilers.
This structure is not technically a definition for QXL device but
is used only for spice-server QXL interface.
As said above this change could affect only MingW/Microsoft that is
only Windows ABI of spice-server (very recently added) so
following lines are really not much important.
Note that Windows does not support architectures with CPUs not
supporting unaligned access.
Under Win32 this change don't affect size so nothing much can change.
This structure is currently passed as value to release_resource
callback. Under Win64 this structure is passed like a
"const QXLReleaseInfoExt *" so even if the structure is 16 bytes instead
of 12 this is read the same way.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Snir Sheriber <ssheribe@redhat.com>
2019-07-21 09:47:20 +01:00
Frediano Ziglio
f436204ead qxl_dev: Fix alignment for QXLReleaseInfo
Do not declare the structure as aligned.
The start/end-packed.h headers affects structures without
specification only using MingW or Microsoft compilers. For other
platform SPICE_ATTR_PACKED macro should be used.  This way the
definition are the same for all compiler.
This structure is used in a lot of QXL structures which are not
aligned causing to have an aligned structure to be potentially
unaligned. Some compilers may report a warning.
As this structure has no holes this change does not make any size
change using any compiler.
The change will only change the alignment from 4/8 to 1.
This could affect structures containing this union however beside
packed structure in qxl_dev.h (which are not affected) there are no
other usages affecting ABI by spice-gtk, Qemu or spice-server.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Snir Sheriber <ssheribe@redhat.com>
2019-07-18 16:38:04 +01:00
Francois Gouget
5874495db3 macros: Remove unused SPICE_GNUC_XXX macros
We don't want to maintain more macros than necessary and these have
been unused for over two years.

Signed-off-by: Francois Gouget <fgouget@codeweavers.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-06-27 09:42:07 +01:00
Frediano Ziglio
fc52cac76f build-sys: post-release version bump 0.14.1
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-05-13 14:55:57 +01:00
Victor Toso
f72ece993a build-sys: add README.md and CHANGELOG.md to tarball
Before renaming README to README.md and NEWS to CHANGELOG.md, we were
shipping those files in the tarball.

I'm fixing this in autotools because it is a 'regression' while
meson.build never had those included.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2019-04-12 13:53:14 +00:00
Victor Toso
f8114fc266 NEWS: prepare for 0.14.0 release
Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2019-04-12 13:04:38 +00:00
Victor Toso
0f6b1848d9 README: Add basic info and .md prefix
Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2019-04-12 13:04:34 +00:00
Victor Toso
9bb75ff1d9 Rename NEWS to CHANGELOG.md
Uppercase + prefix to make Gitlab happy and format it properly.
This should also be the case for all other spice components in Gitlab.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2019-04-12 13:04:30 +00:00
Victor Toso
fc8f868949 ChangeLog: remove old one
Added 193c54c in 2010-02-04 by Alexander Larsson <alexl@redhat.com>
Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2019-04-12 13:04:21 +00:00
Victor Toso
26ca56157c gitlab-ci: add fedora meson+autotools
Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2019-04-12 13:04:17 +00:00
Victor Toso
2256fbe8f6 build-sys: automake: do not require NEWS and ChangeLog
Following patches will rename NEWS to CHANGELOG.md due Gitlab
integration and remove the currently empty ChangeLog.

Signed-off-by: Victor Toso <victortoso@redhat.com>
Acked-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
2019-04-12 13:04:11 +00:00
Frediano Ziglio
0edf46218c Bump minor version to mark cleanup change
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2019-04-06 13:25:52 +01:00
Frediano Ziglio
f7ba19224d protocol: Generate enums.h again to remove old protocol definitions
spice.proto was updated to remove really old definitions,
update enums.h accordingly.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2019-03-29 16:06:32 +00:00
Frediano Ziglio
f6e4cb65da stats: Avoid holes in SpiceStat structure
The SpiceStat structure can be 20 or 24 bytes depending on alignment.
Being a memory mapped structure potentially used with lockless access,
it is not good to have it unaligned.
The only tool that we know of that reads this memory mapped file
(reds_stats) is able to detect if the structure is either 20 or 24
bytes and act accordingly so changing this structure won't affect the
behaviour (unless you have an old tool but as they are usually
packaged together this is quite improbable).
This will also help on Windows as in that system it is not possible
for reds_stats to implement the same discovery trick implemented on
Linux.  On Windows it is not possible to read the size of the file
mapping (on Windows to implement shared memory you can use a file
mapping not associated to a file).
The structure will change layout only on 32-bit architectures which is
not recommended nowadays (the 64-bit platforms that we support align
64-bit integers to 64 bits).

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2019-01-17 17:10:58 +00:00
Lukáš Hrázký
5ab9f2f7a5 Add the StreamMsgGraphicsDeviceInfo message
The message contains information about the graphics device and monitor
belonging to a particular video stream (which maps to a channel) from
the streaming agent.

Signed-off-by: Lukáš Hrázký <lhrazky@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-01-16 13:48:25 +00:00
Lukáš Hrázký
839cd8c1dd Add the VDAgentGraphicsDeviceInfo message
The message serves for passing the device address and device display ID
information for all display channels from SPICE server to the vd_agent.

Signed-off-by: Lukáš Hrázký <lhrazky@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-01-16 13:48:02 +00:00
Marc-André Lureau
578b92e635 build-sys: post-release version bump 0.12.16
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
2019-01-11 21:31:05 +04:00
Marc-André Lureau
9e4414834d NEWS: prepare for 0.12.15 release
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2019-01-11 21:30:28 +04:00
Frediano Ziglio
334cef51d0 error_codes: Remove obsolete header file
This file was used by the old client to hold return error codes.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Snir Sheriber <ssheribe@redhat.com>
2019-01-02 10:00:52 +00:00
Eduardo Lima (Etrunko)
ee136f0050 meson: Add declare_dependency statement
This is required in the case another project uses this one as a subproject

Signed-off-by: Eduardo Lima (Etrunko) <etrunko@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2018-09-26 16:22:07 -03:00
Frediano Ziglio
beda5ec7a6 qxl_dev: Align QXLRam to 4 bytes
This avoids compilers detect misaligned access which can lead to
warnings.
In QEMU the structure is allocated at the beginning of a 4Kb page,
in Xspice is allocated with a calloc, so the structure will end up 4
bytes aligned as well with these users. We are not aware of other users
of QXLRam, but if there was, it's likely the struct would be at least
naturally aligned, so this change should not impact anyone.
Aligning to 4 bytes maintains the size of the structure unchanged
avoiding possible ABI changes.
clang currently generates an invalid function call if a misaligned
4 byte atomic operation is detected.

This fixes https://bugzilla.redhat.com/show_bug.cgi?id=1565766

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Christophe Fergeau <cfergeau@redhat.com>
2018-07-11 10:19:45 +01:00
Christophe Fergeau
dca5931a3a meson: Post-release bump to 0.12.15
This was done for configure.ac earlier, but is missing in meson.build

Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2018-06-21 14:43:45 +01:00
Frediano Ziglio
dec80bfe28 Fix typo in comment
extrenal -> external

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Victor Toso <victortoso@redhat.com>
2018-06-21 11:27:09 +01:00
Snir Sheriber
5e2001b0ed Add support for h265 video codec
Acked-by: Frediano Ziglio <fziglio@redhat.com>
2018-06-19 15:31:32 +01:00
Victor Toso
8460b25eec build-sys: post-release bump 0.12.15
Signed-off-by: Victor Toso <victortoso@redhat.com>
2018-06-01 12:17:48 +02: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 abfdf4d8ab (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
34 changed files with 1845 additions and 1223 deletions

15
.gitignore vendored
View File

@ -1,15 +0,0 @@
Makefile
Makefile.in
aclocal.m4
autom4te.cache
config.h
config.h.in
config.log
config.status
configure
install-sh
ltmain.sh
m4/
missing
spice-protocol.pc
stamp-h1

26
.gitlab-ci.yml Normal file
View File

@ -0,0 +1,26 @@
image: fedora:latest
variables:
DEPS_COMMON: git gcc redhat-rpm-config
meson ninja-build gtk-doc glib2-devel
gettext gettext-devel bzip2 rpmlint rpm-build
mingw32-filesystem mingw64-filesystem
mingw32-gcc mingw64-gcc
before_script:
- dnf install -y $DEPS_COMMON
fedora:
script:
# build project and distribution
- meson --buildtype=release build-default
- ninja -C build-default
- ninja -C build-default dist
# check SPEC file
- rpmlint spice-protocol.spec
# check the SPEC version and project (in meson.build) are the same
- "VER_SPEC=$(sed '/^Version:/!d; s/.*: \\+//' < spice-protocol.spec)"
- "VER_PROJECT=$(sed '/version/ { s/.*'\\''\\(.*\\)'\\''.*/\\1/; q }; d' < meson.build)"
- "test \"x$VER_SPEC\" = \"x$VER_PROJECT\""
# build RPM from tarball generate
- rpmbuild -ta build-default/meson-dist/spice-protocol*.tar.xz

4
.gitpublish Normal file
View File

@ -0,0 +1,4 @@
[gitpublishprofile "default"]
to = spice-devel@lists.freedesktop.org
prefix = PATCH spice-protocol
signoff = true

251
CHANGELOG.md Normal file
View File

@ -0,0 +1,251 @@
Major changes in 0.14.5
=======================
* Add SPICE_MSG_DISPLAY_GL_SCANOUT2_UNIX
* Fix for Windows Arm64 build
Major changes in 0.14.4
=======================
* Fix enum deprecation warning for visual studio
* Fix documentation typos in stream-device.h
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
* Removed foreign-menu and controller interfaces
* Deprecated CELT support
* Generate MingW packages building the RPM
* Allows for the agent to pass back a more specific error to the client
* Add quality indicators messages
Major changes in 0.14.1
=======================
* This is the last release with:
* Autotools: Meson is now the only supported
* foreign_menu_prot.h: Deprecated in this release
* controller_prot.h: Deprecated in this release
* Add VD_AGENT_CAP_CLIPBOARD_NO_RELEASE_ON_REGRAB
* Add VD_AGENT_CAP_CLIPBOARD_GRAB_SERIAL
* Add SPICE_MSGC_MAIN_QUALITY_INDICATOR enum
* Add STREAM_TYPE_QUALITY_INDICATOR message
* Remove deprecated vdi_dev.h interface
* Remove deprecated VD_AGENT_CLIPBOARD_MAX_SIZE_DEFAULT
* Remove deprecated VD_AGENT_CLIPBOARD_MAX_SIZE_ENV
* Remove unused SPICE_GNUC_ macros
* qxl_dev: QXLReleaseInfo alignment fix
* Some documentation added in vd_agentd.h
* Now shipping a rpm spec file to easy deployment and testing
Major changes in 0.14.0
=======================
* Bumping minor to show that some types and values were removed
* Regenerate enums.h (from spice.proto) which removes:
* SpicePubkeyType;
* SpiceTunnelServiceType;
* SpiceTunnelIpType;
* SPICE_MSG_TUNNEL_* and SPICE_MSGC_TUNNEL_*
* Add VDAgentGraphicsDeviceInfo message
* Add StreamMsgGraphicsDeviceInfo message
* Add padding to SpiceStat structure
Major changes in 0.12.15
========================
* Add support for h265 video codec
* qxl_dev: Align QXLRam to 4 bytes
* meson: fix spice-protocol as subproject
Major changes in 0.12.14
========================
* add stream-device protocol
* add SPICE_SURFACE_FLAGS_STREAMING_MODE flag
* add e2k (Elbrus 2000) architecture
* add SPICE_MAX_NUM_STREAMS
* add meson support
* add bult-ins byte swapping for Visual C++
* switch to built-ins byte swapping in GCC
Major changes in 0.12.13
========================
* add DISPLAY_PREFERRED_VIDEO_CODEC_TYPE
* add VP9 codec type
* add VD_AGENT_CLEAR_CAPABILITY() macro
* add VD_AGENT_CAP_FILE_XFER_DISABLED
* add VD_AGENT_FILE_XFER_STATUS_NOT_ENOUGH_SPACE
* add new file-xfer statuses for detailed error
* Change enums.h license to MIT
Major changes in 0.12.12
========================
* protocol: Add lz4 compression support to the SpiceVMC channel
Major changes in 0.12.11
========================
* protocol: add support for the VP8 and h264 video codecs
* protocol: add unix GL scanout messages
* remove code generation scripts, moved back to spice-common
* macros improvements, more type safety
Major changes in 0.12.10
========================
* Add VD_AGENT_CAP_MONITORS_CONFIG_POSITION to handle multi-monitor
configurations that are not multi-head
* Add protocol code generation scripts from spice-common
* Endianness and compiler portability fixes (clang)
Major changes in 0.12.9
=======================
* rename newly introduced SpiceImageCompress enum to SpiceImageCompression
as otherwise it was clashing with the definition used by older spice-server
releases, breaking QEMU build
Major changes in 0.12.8
=======================
* add LZ4 support
* add audio volume synchronization
* deprecate unused vdi-dev
* add 'preferred-compression' message/capability
* add a new Windows driver escape code to send
monitors capability from guest to client
Major changes in 0.12.7
=======================
* add support for Webdav channel
* add support for the Opus codec
Major changes in 0.12.6
=======================
* add adaptive video streaming support:
control playback latency and receive playback
reports from the client.
* add agent capabilities for signaling guest line ending.
Major changes in 0.12.5
=======================
* Add agent file xfer success status
* Add a client-disconnected agent message
Major changes in 0.12.4
=======================
* Add agent file copy support.
* Add agent sparse monitors capability.
* Add controller proxy message.
Major changes in 0.12.3
=======================
* Add a generic "port" channel
Major changes in 0.12.2
=======================
* Add A8 surface capability in display channel.
* Add to qxl device support for:
* client present
* client capabilities
* client monitors configuration
Major changes in 0.12.1
=======================
* Support seamless migration.
* New QXLComposite message for better X support.
* Support arbitrary scancode message INPUTS_KEY_SCANCODE.
Major changes in 0.12.0
=======================
* Add support for arbitrary resolution on Windows QXL with
QXL_ESCAPE_SET_CUSTOM_DISPLAY
* Add support for arbitrary resolution and multiple monitor per
display channel with QXLMonitorsConfig and co
* build cleanup
Major changes in 0.10.3 (0.10.2 was never released)
===================================================
* Add support for video streams with differently sized (wxh) data
* Add controller messages for USB redirection, COLOR_DEPTH, DISABLE_EFFECTS,
and ENABLE_SMARTCARD
* Add name & uuid messages on main channel
* some cleanups
* Fixes RHBZ#815422, RHBZ#807295, RHBZ#787447
Major changes in 0.10.1
=======================
* Add support for a header without sublist and serial (mini header)
Major changes in 0.10.0
=======================
* no changes, released to match version with spice
Major changes in 0.9.1 (same as 0.8.2 in 0.8 branch)
======================
* Add support for semi-seamless migration
Major changes in 0.9.0
======================
* Add support for generic spicevmc chardev passthrough messages
* Add USB redirection channel
Major changes in 0.8.1
======================
* Add support for volume change
* Add support for async guest io writes and interrupt
* Add support for suspend related guest io writes
* Add support for interrupt indicating guest bug
Major changes in 0.8.0
======================
* Add support for different clipboards (selections) to vd_agent copy paste
* Add support for using different authentication mechanisms (just SASL for now)
Major changes in 0.7.1
======================
* Add some enums for the xorg qxl driver
* Some other small fixes
Major changes in 0.7.0
======================
* Add smartcard channel
Major changes in 0.6.4
======================
* Make controller client protocol menu text UTF8 rather then 16 bit unicode
Major changes in 0.6.3:
=======================
* Add support for copy and paste to the agent protocol
* Add foreign-menu and external controller client protocol headers
Major changes in 0.6.2:
=======================
* Skipped to stay in sync with spice
Major changes in 0.6.1:
=======================
* Added compat flag for 16bpp commands
Major changes in 0.6.0:
=======================
* Initial messages for clipboard sharing
* Move agent protocol structs from spice to spice-protocol
* Add capabilities to agent protocol
Major changes in 0.5.3:
=======================
Network major number changed to 2 to reflect that the network
protocol is now stable and backwards compatible from this point.
Some vdagent messages for display settings and clipboard sharing
were added.
Major changes in 0.5.2:
=======================
This is the first release of the unstable 0.5.x series leading up to 0.6.
This module was split out of spice so that e.g. drivers and qemu can
get the types and constants they need without using the full spice
codebase.

View File

View File

@ -1 +0,0 @@
/usr/share/automake-1.11/INSTALL

View File

@ -1,7 +0,0 @@
SUBDIRS = spice
pkgconfigdir = $(datadir)/pkgconfig
pkgconfig_DATA = spice-protocol.pc
DISTCLEANFILES = \
spice-protocol.pc

7
NEWS
View File

@ -1,7 +0,0 @@
Major changes in 0.5.2:
=======================
This is the first release of the unstable 0.5.x series leading up to 0.6.
This module was split out of spice so that e.g. drivers and qemu can
get the types and constants they need without using the full spice
codebase.

0
README
View File

27
README.md Normal file
View File

@ -0,0 +1,27 @@
spice-protocol
==============
The protocol definition for [SPICE] project used by:
* [spice-server]: A server side library used by [QEMU] and [x11spice];
* [spice-gtk]: A client side library used by [virt-viewer and virt-manager] and
[GNOME Boxes];
* [linux/vd-agent] and [win32/vd-agent]: Guest components for Linux and Windows
* [xf86-video-qxl], [gpu/drm/qxl], [win32/qxl], [win32/qxl-wddm-dod]: Guest video
drivers;
Please [report bugs] at Freedesktop's instance of Gitlab
[SPICE]: https://spice-space.org
[spice-server]: https://gitlab.freedesktop.org/spice/spice
[QEMU]: https://www.qemu.org
[x11spice]: https://gitlab.com/spice/x11spice
[spice-gtk]: https://gitlab.freedesktop.org/spice/spice-gtk
[virt-viewer and virt-manager]: https://virt-manager.org/
[GNOME Boxes]: https://wiki.gnome.org/Apps/Boxes
[linux/vd-agent]: https://gitlab.freedesktop.org/spice/linux/vd_agent
[win32/vd-agent]: https://gitlab.freedesktop.org/spice/win32/vd_agent
[xf86-video-qxl]: https://gitlab.freedesktop.org/xorg/driver/xf86-video-qxl
[gpu/drm/qxl]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/qxl
[win32/qxl]: https://gitlab.freedesktop.org/spice/win32/qxl
[win32/qxl-wddm-dod]: https://gitlab.freedesktop.org/spice/win32/qxl-wddm-dod
[report bugs]: https://gitlab.freedesktop.org/spice/spice-protocol/issues/

View File

@ -1,164 +0,0 @@
#! /bin/sh
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
ORIGDIR=`pwd`
cd $srcdir
# FIXME: can replace this entire script with
# the following line if we can require autoconf 2.60:
# autoreconf -v --force --install || exit 1
PACKAGE=spice-protocol
ACLOCAL_FLAGS=""
AUTOHEADER=${AUTOHEADER-autoheader}
AUTOMAKE_FLAGS="--add-missing --gnu"
AUTOCONF=${AUTOCONF-autoconf}
# automake 1.8 requires autoconf 2.58
# automake 1.7 requires autoconf 2.54
automake_min_vers=1.7
aclocal_min_vers=$automake_min_vers
autoconf_min_vers=2.54
# The awk-based string->number conversion we use needs a C locale to work
# as expected. Setting LC_ALL overrides whether the user set LC_ALL,
# LC_NUMERIC, or LANG.
LC_ALL=C
ARGV0=$0
# Allow invocation from a separate build directory; in that case, we change
# to the source directory to run the auto*, then change back before running configure
srcdir=`dirname $ARGV0`
test -z "$srcdir" && srcdir=.
ORIGDIR=`pwd`
# Not all echo versions allow -n, so we check what is possible. This test is
# based on the one in autoconf.
case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
*c*,-n*) ECHO_N= ;;
*c*,* ) ECHO_N=-n ;;
*) ECHO_N= ;;
esac
# some terminal codes ...
boldface="`tput bold 2>/dev/null || true`"
normal="`tput sgr0 2>/dev/null || true`"
printbold() {
echo $ECHO_N "$boldface"
echo "$@"
echo $ECHO_N "$normal"
}
printerr() {
echo "$@" >&2
}
# Usage:
# compare_versions MIN_VERSION ACTUAL_VERSION
# returns true if ACTUAL_VERSION >= MIN_VERSION
compare_versions() {
ch_min_version=$1
ch_actual_version=$2
ch_status=0
IFS="${IFS= }"; ch_save_IFS="$IFS"; IFS="."
set $ch_actual_version
for ch_min in $ch_min_version; do
ch_cur=`echo $1 | sed 's/[^0-9].*$//'`; shift # remove letter suffixes
if [ -z "$ch_min" ]; then break; fi
if [ -z "$ch_cur" ]; then ch_status=1; break; fi
if [ $ch_cur -gt $ch_min ]; then break; fi
if [ $ch_cur -lt $ch_min ]; then ch_status=1; break; fi
done
IFS="$ch_save_IFS"
return $ch_status
}
# Usage:
# version_check PACKAGE VARIABLE CHECKPROGS MIN_VERSION SOURCE
# checks to see if the package is available
version_check() {
vc_package=$1
vc_variable=$2
vc_checkprogs=$3
vc_min_version=$4
vc_source=$5
vc_status=1
vc_checkprog=`eval echo "\\$$vc_variable"`
if [ -n "$vc_checkprog" ]; then
printbold "using $vc_checkprog for $vc_package"
return 0
fi
printbold "checking for $vc_package >= $vc_min_version..."
for vc_checkprog in $vc_checkprogs; do
echo $ECHO_N " testing $vc_checkprog... "
if $vc_checkprog --version < /dev/null > /dev/null 2>&1; then
vc_actual_version=`$vc_checkprog --version | head -n 1 | \
sed 's/^.*[ ]\([0-9.]*[a-z]*\).*$/\1/'`
if compare_versions $vc_min_version $vc_actual_version; then
echo "found $vc_actual_version"
# set variable
eval "$vc_variable=$vc_checkprog"
vc_status=0
break
else
echo "too old (found version $vc_actual_version)"
fi
else
echo "not found."
fi
done
if [ "$vc_status" != 0 ]; then
printerr "***Error***: You must have $vc_package >= $vc_min_version installed"
printerr " to build $PROJECT. Download the appropriate package for"
printerr " from your distribution or get the source tarball at"
printerr " $vc_source"
printerr
fi
return $vc_status
}
version_check autoconf AUTOCONF $AUTOCONF $autoconf_min_vers \
"http://ftp.gnu.org/pub/gnu/autoconf/autoconf-${autoconf_min_vers}.tar.gz" || DIE=1
version_check automake AUTOMAKE "$AUTOMAKE automake automake-1.10 automake-1.9 automake-1.8 automake-1.7" $automake_min_vers \
"http://ftp.gnu.org/pub/gnu/automake/automake-${automake_min_vers}.tar.gz" || DIE=1
ACLOCAL=`echo $AUTOMAKE | sed s/automake/aclocal/`
if test -n "$DIE"; then
exit 1
fi
if test -z "$*"; then
echo "$ARGV0: Note: \`./configure' will be run with no arguments."
echo " If you wish to pass any to it, please specify them on the"
echo " \`$0' command line."
echo
fi
do_cmd() {
echo "$ARGV0: running \`$@'"
$@
}
# Run for top level directory
printbold "Setting up $PACKAGE toplevel"
cd $srcdir
do_cmd $ACLOCAL $ACLOCAL_FLAGS
do_cmd $AUTOHEADER
do_cmd $AUTOMAKE $AUTOMAKE_FLAGS
do_cmd $AUTOCONF
cd $ORIGDIR || exit $?
rm -f config.cache
do_cmd $srcdir/configure --enable-maintainer-mode ${1+"$@"} || exit 1

View File

@ -1,19 +0,0 @@
AC_PREREQ([2.57])
m4_define([SPICE_MAJOR], 0)
m4_define([SPICE_MINOR], 5)
m4_define([SPICE_MICRO], 2)
AC_INIT(spice-protocol, [SPICE_MAJOR.SPICE_MINOR.SPICE_MICRO], [], spice-protocol)
AC_CONFIG_MACRO_DIR([m4])
AM_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE([dist-bzip2])
AM_MAINTAINER_MODE
AC_OUTPUT([
Makefile
spice-protocol.pc
spice/Makefile
])

27
docs/how_to_release.md Normal file
View File

@ -0,0 +1,27 @@
How to do a SPICE protocol release
==================================
Some notes to prepare a release, not really strict but better to have in order
to avoid forgetting something.
* Check `meson.build` and `spice-protocol.spec` for release number
* Update `CHANGELOG.md` with list of changes done since last release
* Send a merge request with such changes, handle the review
* Build distribution file with `meson dist`
* Try to build an RPM package from `meson dist` output
* `git push` for the above MR
* Create a git tag (like `git tag -a v0.14.3 -m 'Release v0.14.3'`)
* `git push` for the version tag created (for instance you can use
`git push origin v0.14.3` or `git push --tags`)
* Sign generated tarball (to create a detached signature run
`gpg2 -sb spice-protocol-RELEASE.tar.xz`)
* On Gitlab update tags (https://gitlab.freedesktop.org/spice/spice-protocol/-/tags)
* Add ChangeLog information
* Upload tarball and relative signature
* Upload tarball and relative signature and sha256sum to
https://www.spice-space.org/download/releases/ (sftp to
`spice-uploader@spice-web.osci.io:/var/www/www.spice-space.org/download/releases/`)
* Update file `download.rst` in
https://gitlab.freedesktop.org/spice/spice-space-pages
* Send an email to spice-devel mailing list
* Bump version post release and send a new MR

View File

@ -1,8 +0,0 @@
s#\"qxl_dev\.h\"#<spice/qxl_dev\.h>#
s#\"draw\.h\"#<spice/draw\.h>#
s#\"ipc_ring\.h\"#<spice/ipc_ring\.h>#
s#\"red\.h\"#<spice/protocol\.h>#
s#\"red_error_codes\.h\"#<spice/error_codes\.h>#
s#\"reds_stat\.h\"#<spice/stats\.h>#
s#\"vd_agent\.h\"#<spice/vd_agent\.h>#
s#\"vdi_dev\.h\"#<spice/vdi_dev\.h>#

26
meson.build Normal file
View File

@ -0,0 +1,26 @@
#
# project definition
#
project('spice-protocol',
'c',
version : '0.14.5',
license : 'BSD',
meson_version : '>= 0.41.0')
subdir('spice')
spice_protocol_dep = declare_dependency(include_directories : include_directories('.'))
#
# spice-protocol.pc generation
#
datadir = get_option('datadir')
pkgconfig_dir = join_paths(get_option('prefix'), datadir, 'pkgconfig')
pkgconfig = import('pkgconfig')
pkgconfig.generate(name : meson.project_name(),
description : 'SPICE protocol headers',
version : meson.project_version(),
subdirs : 'spice-1',
install_dir : pkgconfig_dir,
variables : 'datadir=@0@'.format(join_paths('${prefix}', datadir)))

View File

@ -1,9 +0,0 @@
#!/bin/sh
SEDFILE=`mktemp`
awk '$0 !~ /^#.*/ && (NF == 2) { print "s/\\(^\\|[^A-Za-z_]\\)\\(" $1 "\\)\\($\\|[^A-Za-z0-9_]\\)/\\1" $2 "\\3/g" }' $1 > $SEDFILE
shift
sed -f $SEDFILE -i $*
rm $SEDFILE

522
renames
View File

@ -1,522 +0,0 @@
RED_MAGIC SPICE_MAGIC
RED_VERSION_MAJOR SPICE_VERSION_MAJOR
RED_VERSION_MINOR SPICE_VERSION_MINOR
RED_MAX_PASSWORD_LENGTH SPICE_MAX_PASSWORD_LENGTH
RED_TICKET_KEY_PAIR_LENGTH SPICE_TICKET_KEY_PAIR_LENGTH
RED_TICKET_PUBKEY_BYTES SPICE_TICKET_PUBKEY_BYTES
# Channel types
RED_CHANNEL_MAIN SPICE_CHANNEL_MAIN
RED_CHANNEL_DISPLAY SPICE_CHANNEL_DISPLAY
RED_CHANNEL_INPUTS SPICE_CHANNEL_INPUTS
RED_CHANNEL_CURSOR SPICE_CHANNEL_CURSOR
RED_CHANNEL_PLAYBACK SPICE_CHANNEL_PLAYBACK
RED_CHANNEL_RECORD SPICE_CHANNEL_RECORD
RED_CHANNEL_TUNNEL SPICE_CHANNEL_TUNNEL
RED_CHANNEL_END SPICE_END_CHANNEL
RED_ERR_OK SPICE_LINK_ERR_OK
RED_ERR_ERROR SPICE_LINK_ERR_ERROR
RED_ERR_INVALID_MAGIC SPICE_LINK_ERR_INVALID_MAGIC
RED_ERR_INVALID_DATA SPICE_LINK_ERR_INVALID_DATA
RED_ERR_VERSION_MISMATCH SPICE_LINK_ERR_VERSION_MISMATCH
RED_ERR_NEED_SECURED SPICE_LINK_ERR_NEED_SECURED
RED_ERR_NEED_UNSECURED SPICE_LINK_ERR_NEED_UNSECURED
RED_ERR_PERMISSION_DENIED SPICE_LINK_ERR_PERMISSION_DENIED
RED_ERR_BAD_CONNECTION_ID SPICE_LINK_ERR_BAD_CONNECTION_ID
RED_ERR_CHANNEL_NOT_AVAILABLE SPICE_LINK_ERR_CHANNEL_NOT_AVAILABLE
RED_ERR_ SPICE_ERR_
RED_WARN_GENERAL SPICE_WARN_GENERAL
RED_INFO_GENERAL SPICE_INFO_GENERAL
RedLinkHeader SpiceLinkHeader
RedLinkMess SpiceLinkMess
RedLinkReply SpiceLinkReply
RedLinkEncryptedTicket SpiceLinkEncryptedTicket
RedDataHeader SpiceDataHeader
RedSubMessage SpicedSubMessage
RedSubMessageList SpiceSubMessageList
RED_MIGRATE SPICE_MSG_MIGRATE
RED_MIGRATE_DATA SPICE_MSG_MIGRATE_DATA
RED_SET_ACK SPICE_MSG_SET_ACK
RED_PING SPICE_MSG_PING
RED_WAIT_FOR_CHANNELS SPICE_MSG_WAIT_FOR_CHANNELS
RED_DISCONNECTING SPICE_MSG_DISCONNECTING
RED_NOTIFY SPICE_MSG_NOTIFY
RED_FIRST_AVAIL_MESSAGE SPICE_MSG_FIRST_AVAIL
REDC_ACK_SYNC SPICE_MSGC_ACK_SYNC
REDC_ACK SPICE_MSGC_ACK
REDC_PONG SPICE_MSGC_PONG
REDC_MIGRATE_FLUSH_MARK SPICE_MSGC_MIGRATE_FLUSH_MARK
REDC_MIGRATE_DATA SPICE_MSGC_MIGRATE_DATA
REDC_DISCONNECTING SPICE_MSGC_DISCONNECTING
REDC_FIRST_AVAIL_MESSAGE SPICE_MSGC_FIRST_AVAIL
RED_MIGRATE_BEGIN SPICE_MSG_MAIN_MIGRATE_BEGIN
RED_MIGRATE_CANCEL SPICE_MSG_MAIN_MIGRATE_CANCEL
RED_INIT SPICE_MSG_MAIN_INIT
RED_CHANNELS_LIST SPICE_MSG_MAIN_CHANNELS_LIST
RED_MOUSE_MODE SPICE_MSG_MAIN_MOUSE_MODE
RED_MULTI_MEDIA_TIME SPICE_MSG_MAIN_MULTI_MEDIA_TIME
RED_AGENT_CONNECTED SPICE_MSG_MAIN_AGENT_CONNECTED
RED_AGENT_DISCONNECTED SPICE_MSG_MAIN_AGENT_DISCONNECTED
RED_AGENT_DATA SPICE_MSG_MAIN_AGENT_DATA
RED_AGENT_TOKEN SPICE_MSG_MAIN_AGENT_TOKEN
RED_MESSAGES_END SPICE_MSG_END_MAIN
REDC_CLIENT_INFO SPICE_MSGC_MAIN_CLIENT_INFO
REDC_MIGRATE_CONNECTED SPICE_MSGC_MAIN_MIGRATE_CONNECTED
REDC_MIGRATE_CONNECT_ERROR SPICE_MSGC_MAIN_MIGRATE_CONNECT_ERROR
REDC_ATTACH_CHANNELS SPICE_MSGC_MAIN_ATTACH_CHANNELS
REDC_MOUSE_MODE_REQUEST SPICE_MSGC_MAIN_MOUSE_MODE_REQUEST
REDC_AGENT_START SPICE_MSGC_MAIN_AGENT_START
REDC_AGENT_DATA SPICE_MSGC_MAIN_AGENT_DATA
REDC_AGENT_TOKEN SPICE_MSGC_MAIN_AGENT_TOKEN
RED_INPUTS_INIT SPICE_MSG_INPUTS_INIT
RED_INPUTS_KEY_MODIFAIERS SPICE_MSG_INPUTS_KEY_MODIFIERS
RED_INPUTS_MOUSE_MOTION_ACK SPICE_MSG_INPUTS_MOUSE_MOTION_ACK
RED_INPUTS_MESSAGES_END SPICE_MSG_END_INPUTS
RED_MOTION_ACK_BUNCH SPICE_INPUT_MOTION_ACK_BUNCH
RED_SCROLL_LOCK_MODIFIER SPICE_SCROLL_LOCK_MODIFIER
RED_NUM_LOCK_MODIFIER SPICE_NUM_LOCK_MODIFIER
RED_CAPS_LOCK_MODIFIER SPICE_CAPS_LOCK_MODIFIER
RedInputsInit SpiceMsgInputsInit
RedKeyModifiers SpiceMsgInputsKeyModifiers
RedMultiMediaTime SpiceMsgMainMultiMediaTime
RED_PUBKEY_TYPE_INVALID SPICE_PUBKEY_TYPE_INVALID
RED_PUBKEY_TYPE_RSA SPICE_PUBKEY_TYPE_RSA
RED_PUBKEY_TYPE_RSA2 SPICE_PUBKEY_TYPE_RSA2
RED_PUBKEY_TYPE_DSA SPICE_PUBKEY_TYPE_DSA
RED_PUBKEY_TYPE_DSA1 SPICE_PUBKEY_TYPE_DSA1
RED_PUBKEY_TYPE_DSA2 SPICE_PUBKEY_TYPE_DSA2
RED_PUBKEY_TYPE_DSA3 SPICE_PUBKEY_TYPE_DSA3
RED_PUBKEY_TYPE_DSA4 SPICE_PUBKEY_TYPE_DSA4
RED_PUBKEY_TYPE_DH SPICE_PUBKEY_TYPE_DH
RED_PUBKEY_TYPE_EC SPICE_PUBKEY_TYPE_EC
RedMigrationBegin SpiceMsgMainMigrationBegin
RED_MIGRATE_NEED_FLUSH SPICE_MIGRATE_NEED_FLUSH
RED_MIGRATE_NEED_DATA_TRANSFER SPICE_MIGRATE_NEED_DATA_TRANSFER
RED_RES_TYPE_INVALID SPICE_RES_TYPE_INVALID
RED_RES_TYPE_PIXMAP SPICE_RES_TYPE_PIXMAP
RedResorceID SpiceResorceID
RedResorceList SpiceResorceList
RedSetAck SpiceMsgSetAck
RedWaitForChannel SpiceWaitForChannel
RedWaitForChannels SpiceMsgWaitForChannels
# This seems to have the wrong name compared to the protocol docs, fix
RedChannelInit SpiceChannelId
RedMigrate SpiceMsgMigrate
RedInit SpiceMsgMainInit
RedDisconnect SpiceMsgDisconnect
RED_NOTIFY_SEVERITY_INFO SPICE_NOTIFY_SEVERITY_INFO
RED_NOTIFY_SEVERITY_WARN SPICE_NOTIFY_SEVERITY_WARN
RED_NOTIFY_SEVERITY_ERROR SPICE_NOTIFY_SEVERITY_ERROR
RED_NOTIFY_VISIBILITY_LOW SPICE_NOTIFY_VISIBILITY_LOW
RED_NOTIFY_VISIBILITY_MEDIUM SPICE_NOTIFY_VISIBILITY_MEDIUM
RED_NOTIFY_VISIBILITY_HIGH SPICE_NOTIFY_VISIBILITY_HIGH
RedNotify SpiceMsgNotify
RedChannels SpiceMsgChannels
RedMouseMode SpiceMsgMainMouseMode
RedPing SpiceMsgPing
RedAgentDisconnect SpiceMsgMainAgentDisconnect
RedAgentTokens SpiceMsgMainAgentTokens
RedcAgentTokens SpiceMsgcMainAgentTokens
RedcAgentStart SpiceMsgcMainAgentStart
# This seem unused in the codebase???
RedcClientInfo SpiceMsgcClientInfo
RedcMouseModeRequest SpiceMsgcMainMouseModeRequest
RED_AGENT_MAX_DATA_SIZE SPICE_AGENT_MAX_DATA_SIZE
RED_DISPLAY_MODE SPICE_MSG_DISPLAY_MODE
RED_DISPLAY_MARK SPICE_MSG_DISPLAY_MARK
RED_DISPLAY_RESET SPICE_MSG_DISPLAY_RESET
RED_DISPLAY_COPY_BITS SPICE_MSG_DISPLAY_COPY_BITS
RED_DISPLAY_INVAL_LIST SPICE_MSG_DISPLAY_INVAL_LIST
RED_DISPLAY_INVAL_ALL_PIXMAPS SPICE_MSG_DISPLAY_INVAL_ALL_PIXMAPS
RED_DISPLAY_INVAL_PALETTE SPICE_MSG_DISPLAY_INVAL_PALETTE
RED_DISPLAY_INVAL_ALL_PALETTES SPICE_MSG_DISPLAY_INVAL_ALL_PALETTES
RED_DISPLAY_STREAM_CREATE SPICE_MSG_DISPLAY_STREAM_CREATE
RED_DISPLAY_STREAM_DATA SPICE_MSG_DISPLAY_STREAM_DATA
RED_DISPLAY_STREAM_CLIP SPICE_MSG_DISPLAY_STREAM_CLIP
RED_DISPLAY_STREAM_DESTROY SPICE_MSG_DISPLAY_STREAM_DESTROY
RED_DISPLAY_STREAM_DESTROY_ALL SPICE_MSG_DISPLAY_STREAM_DESTROY_ALL
RED_DISPLAY_DRAW_FILL SPICE_MSG_DISPLAY_DRAW_FILL
RED_DISPLAY_DRAW_OPAQUE SPICE_MSG_DISPLAY_DRAW_OPAQUE
RED_DISPLAY_DRAW_COPY SPICE_MSG_DISPLAY_DRAW_COPY
RED_DISPLAY_DRAW_BLEND SPICE_MSG_DISPLAY_DRAW_BLEND
RED_DISPLAY_DRAW_BLACKNESS SPICE_MSG_DISPLAY_DRAW_BLACKNESS
RED_DISPLAY_DRAW_WHITENESS SPICE_MSG_DISPLAY_DRAW_WHITENESS
RED_DISPLAY_DRAW_INVERS SPICE_MSG_DISPLAY_DRAW_INVERS
RED_DISPLAY_DRAW_ROP3 SPICE_MSG_DISPLAY_DRAW_ROP3
RED_DISPLAY_DRAW_STROKE SPICE_MSG_DISPLAY_DRAW_STROKE
RED_DISPLAY_DRAW_TEXT SPICE_MSG_DISPLAY_DRAW_TEXT
RED_DISPLAY_DRAW_TRANSPARENT SPICE_MSG_DISPLAY_DRAW_TRANSPARENT
RED_DISPLAY_DRAW_ALPHA_BLEND SPICE_MSG_DISPLAY_DRAW_ALPHA_BLEND
RED_DISPLAY_MESSAGES_END SPICE_MSG_END_DISPLAY
RED_CURSOR_NONE SPICE_CURSOR_FLAGS_NONE
RED_CURSOR_CACHE_ME SPICE_CURSOR_FLAGS_CACHE_ME
RED_CURSOR_FROM_CACHE SPICE_CURSOR_FLAGS_FROM_CACHE
RedCursor SpiceCursor
RedMode SpiceMsgDisplayMode
RedDrawBase SpiceMsgDisplayBase
RedCopyBits SpiceMsgDisplayCopyBits
RedFill SpiceMsgDisplayDrawFill
RedOpaque SpiceMsgDisplayDrawOpaque
RedCopy SpiceMsgDisplayDrawCopy
RedTransparent SpiceMsgDisplayDrawTransparent
RedAlphaBlend SpiceMsgDisplayDrawAlphaBlend
RedBlend SpiceMsgDisplayDrawBlend
RedRop3 SpiceMsgDisplayDrawRop3
RedBlackness SpiceMsgDisplayDrawBlackness
RedWhiteness SpiceMsgDisplayDrawWhiteness
RedInvers SpiceMsgDisplayDrawInvers
RedStroke SpiceMsgDisplayDrawStroke
RedText SpiceMsgDisplayDrawText
RedInvalOne SpiceMsgDisplayInvalOne
RED_VIDEO_CODEC_TYPE_MJPEG SPICE_VIDEO_CODEC_TYPE_MJPEG
STREAM_TOP_DOWN SPICE_STREAM_FLAGS_TOP_DOWN
RedStreamCreate SpiceMsgDisplayStreamCreate
RedStreamData SpiceMsgDisplayStreamData
RedStreamClip SpiceMsgDisplayStreamClip
RedStreamDestroy SpiceMsgDisplayStreamDestroy
RED_CURSOR_INIT SPICE_MSG_CURSOR_INIT
RED_CURSOR_RESET SPICE_MSG_CURSOR_RESET
RED_CURSOR_SET SPICE_MSG_CURSOR_SET
RED_CURSOR_MOVE SPICE_MSG_CURSOR_MOVE
RED_CURSOR_HIDE SPICE_MSG_CURSOR_HIDE
RED_CURSOR_TRAIL SPICE_MSG_CURSOR_TRAIL
RED_CURSOR_INVAL_ONE SPICE_MSG_CURSOR_INVAL_ONE
RED_CURSOR_INVAL_ALL SPICE_MSG_CURSOR_INVAL_ALL
RED_CURSOR_MESSAGES_END SPICE_MSG_END_CURSOR
RedCursorInit SpiceMsgCursorInit
RedCursorSet SpiceMsgCursorSet
RedCursorMove SpiceMsgCursorMove
RedCursorTrail SpiceMsgCursorTrail
REDC_DISPLAY_INIT SPICE_MSGC_DISPLAY_INIT
REDC_DISPLAY_MESSGES_END SPICE_MSGC_END_DISPLAY
RedcDisplayInit SpiceMsgcDisplayInit
REDC_INPUTS_KEY_DOWN SPICE_MSGC_INPUTS_KEY_DOWN
REDC_INPUTS_KEY_UP SPICE_MSGC_INPUTS_KEY_UP
REDC_INPUTS_KEY_MODIFAIERS SPICE_MSGC_INPUTS_KEY_MODIFIERS
REDC_INPUTS_MOUSE_MOTION SPICE_MSGC_INPUTS_MOUSE_MOTION
REDC_INPUTS_MOUSE_POSITION SPICE_MSGC_INPUTS_MOUSE_POSITION
REDC_INPUTS_MOUSE_PRESS SPICE_MSGC_INPUTS_MOUSE_PRESS
REDC_INPUTS_MOUSE_RELEASE SPICE_MSGC_INPUTS_MOUSE_RELEASE
REDC_INPUTS_MESSGES_END SPICE_MSGC_END_INPUTS_MESSGES
RedcKeyDown SpiceMsgcKeyDown
RedcKeyUp SpiceMsgcKeyUp
RED_MOUSE_MODE_SERVER SPICE_MOUSE_MODE_SERVER
RED_MOUSE_MODE_CLIENT SPICE_MOUSE_MODE_CLIENT
RedcKeyModifiers SpiceMsgcKeyModifiers
RedButton SpiceMouseButton
REDC_MOUSE_INVALID_BUTTON SPICE_MOUSE_BUTTON_INVALID
REDC_MOUSE_LBUTTON SPICE_MOUSE_BUTTON_LEFT
REDC_MOUSE_MBUTTON SPICE_MOUSE_BUTTON_MIDDLE
REDC_MOUSE_RBUTTON SPICE_MOUSE_BUTTON_RIGHT
REDC_MOUSE_UBUTTON SPICE_MOUSE_BUTTON_UP
REDC_MOUSE_DBUTTON SPICE_MOUSE_BUTTON_DOWN
REDC_LBUTTON_MASK SPICE_MOUSE_BUTTON_MASK_LEFT
REDC_MBUTTON_MASK SPICE_MOUSE_BUTTON_MASK_MIDDLE
REDC_RBUTTON_MASK SPICE_MOUSE_BUTTON_MASK_RIGHT
RedcMouseMotion SpiceMsgcMouseMotion
RedcMousePosition SpiceMsgcMousePosition
RedcMousePress SpiceMsgcMousePress
RedcMouseRelease SpiceMsgcMouseRelease
RED_AUDIO_FMT_INVALD SPICE_AUDIO_FMT_INVALD
RED_AUDIO_FMT_S16 SPICE_AUDIO_FMT_S16
RED_AUDIO_FMT_ SPICE_AUDIO_FMT_
RED_AUDIO_DATA_MODE_INVALD SPICE_AUDIO_DATA_MODE_INVALD
RED_AUDIO_DATA_MODE_RAW SPICE_AUDIO_DATA_MODE_RAW
RED_AUDIO_DATA_MODE_CELT_0_5_1 SPICE_AUDIO_DATA_MODE_CELT_0_5_1
RED_AUDIO_DATA_MODE_ SPICE_AUDIO_DATA_MODE_
RED_PLAYBACK_DATA SPICE_MSG_PLAYBACK_DATA
RED_PLAYBACK_MODE SPICE_MSG_PLAYBACK_MODE
RED_PLAYBACK_START SPICE_MSG_PLAYBACK_START
RED_PLAYBACK_STOP SPICE_MSG_PLAYBACK_STOP
RED_PLAYBACK_MESSAGES_END SPICE_MSG_END_PLAYBACK
RED_PLAYBACK_CAP_CELT_0_5_1 SPICE_PLAYBACK_CAP_CELT_0_5_1
RED_RECORD_START SPICE_MSG_RECORD_START
RED_RECORD_STOP SPICE_MSG_RECORD_STOP
RED_RECORD_MESSAGES_END SPICE_MSG_END_RECORD
RED_RECORD_CAP_CELT_0_5_1 SPICE_RECORD_CAP_CELT_0_5_1
RedPlaybackMode SpiceMsgPlaybackMode
RedPlaybackStart SpiceMsgPlaybackStart
RedPlaybackPacket SpiceMsgPlaybackPacket
RedRecordStart SpiceMsgRecordStart
RedcRecordMode SpiceMsgcRecordMode
RedcRecordPacket SpiceMsgcRecordPacket
RedcRecordStartMark SpiceMsgcRecordStartMark
REDC_RECORD_DATA SPICE_MSGC_RECORD_DATA
REDC_RECORD_MODE SPICE_MSGC_RECORD_MODE
REDC_RECORD_START_MARK SPICE_MSGC_RECORD_START_MARK
REDC_RECORD_MESSAGES_END SPICE_MSGC_END_RECORD
RED_TUNNEL_SERVICE_TYPE_INVALID SPICE_TUNNEL_SERVICE_TYPE_INVALID
RED_TUNNEL_SERVICE_TYPE_GENERIC SPICE_TUNNEL_SERVICE_TYPE_GENERIC
RED_TUNNEL_SERVICE_TYPE_IPP SPICE_TUNNEL_SERVICE_TYPE_IPP
RED_TUNNEL_INIT SPICE_MSG_TUNNEL_INIT
RED_TUNNEL_SERVICE_IP_MAP SPICE_MSG_TUNNEL_SERVICE_IP_MAP
RED_TUNNEL_SOCKET_OPEN SPICE_MSG_TUNNEL_SOCKET_OPEN
RED_TUNNEL_SOCKET_FIN SPICE_MSG_TUNNEL_SOCKET_FIN
RED_TUNNEL_SOCKET_CLOSE SPICE_MSG_TUNNEL_SOCKET_CLOSE
RED_TUNNEL_SOCKET_DATA SPICE_MSG_TUNNEL_SOCKET_DATA
RED_TUNNEL_SOCKET_CLOSED_ACK SPICE_MSG_TUNNEL_SOCKET_CLOSED_ACK
RED_TUNNEL_SOCKET_TOKEN SPICE_MSG_TUNNEL_SOCKET_TOKEN
RED_TUNNEL_MESSAGES_END SPICE_MSG_END_TUNNEL
RedTunnelIPv4 SpiceTunnelIPv4
RED_TUNNEL_IP_TYPE_INVALID SPICE_TUNNEL_IP_TYPE_INVALID
RED_TUNNEL_IP_TYPE_IPv4 SPICE_TUNNEL_IP_TYPE_IPv4
RedTunnelInit SpiceMsgTunnelInit
RedTunnelIpInfo SpiceMsgTunnelIpInfo
RedTunnelServiceIpMap SpiceMsgTunnelServiceIpMap
RedTunnelSocketOpen SpiceMsgTunnelSocketOpen
RedTunnelSocketFin SpiceMsgTunnelSocketFin
RedTunnelSocketClose SpiceMsgTunnelSocketClose
RedTunnelSocketData SpiceMsgTunnelSocketData
RedTunnelSocketTokens SpiceMsgTunnelSocketTokens
RedTunnelSocketClosedAck SpiceMsgTunnelSocketClosedAck
REDC_TUNNEL_SERVICE_ADD SPICE_MSGC_TUNNEL_SERVICE_ADD
REDC_TUNNEL_SERVICE_REMOVE SPICE_MSGC_TUNNEL_SERVICE_REMOVE
REDC_TUNNEL_SOCKET_OPEN_ACK SPICE_MSGC_TUNNEL_SOCKET_OPEN_ACK
REDC_TUNNEL_SOCKET_OPEN_NACK SPICE_MSGC_TUNNEL_SOCKET_OPEN_NACK
REDC_TUNNEL_SOCKET_FIN SPICE_MSGC_TUNNEL_SOCKET_FIN
REDC_TUNNEL_SOCKET_CLOSED SPICE_MSGC_TUNNEL_SOCKET_CLOSED
REDC_TUNNEL_SOCKET_CLOSED_ACK SPICE_MSGC_TUNNEL_SOCKET_CLOSED_ACK
REDC_TUNNEL_SOCKET_DATA SPICE_MSGC_TUNNEL_SOCKET_DATA
REDC_TUNNEL_SOCKET_TOKEN SPICE_MSGC_TUNNEL_SOCKET_TOKEN
REDC_TUNNEL_MESSGES_END SPICE_MSGC_END_TUNNEL
RedcTunnelAddGenericService SpiceMsgcTunnelAddGenericService
RedcTunnelAddPrintService SpiceMsgcTunnelAddPrintService
RedcTunnelRemoveService SpiceMsgcTunnelRemoveService
RedcTunnelSocketOpenAck SpiceMsgcTunnelSocketOpenAck
RedcTunnelSocketOpenNack SpiceMsgcTunnelSocketOpenNack
RedcTunnelSocketData SpiceMsgcTunnelSocketData
RedcTunnelSocketFin SpiceMsgcTunnelSocketFin
RedcTunnelSocketClosed SpiceMsgcTunnelSocketClosed
RedcTunnelSocketClosedAck SpiceMsgcTunnelSocketClosedAck
RedcTunnelSocketTokens SpiceMsgcTunnelSocketTokens
FIXED28_4 SPICE_FIXED28_4
ADDRESS SPICE_ADDRESS
GET_ADDRESS SPICE_GET_ADDRESS
SET_ADDRESS SPICE_SET_ADDRESS
PATH_BEGIN SPICE_PATH_BEGIN
PATH_END SPICE_PATH_END
PATH_CLOSE SPICE_PATH_CLOSE
PATH_BEZIER SPICE_PATH_BEZIER
LINE_ATTR_STARTGAP SPICE_LINE_ATTR_STARTGAP
LINE_ATTR_STYLED SPICE_LINE_ATTR_STYLED
PointFix SpicePointFix
Point SpicePoint
Point16 SpicePoint16
Rect SpiceRect
PathSeg SpicePathSeg
ClipType SpiceClipType
CLIP_TYPE_NONE SPICE_CLIP_TYPE_NONE
CLIP_TYPE_RECTS SPICE_CLIP_TYPE_RECTS
CLIP_TYPE_PATH SPICE_CLIP_TYPE_PATH
Clip SpiceClip
ROPDescriptor SpiceROPDescriptor
Pattern SpicePattern
BRUSH_TYPE_NONE SPICE_BRUSH_TYPE_NONE
BRUSH_TYPE_SOLID SPICE_BRUSH_TYPE_SOLID
BRUSH_TYPE_PATTERN SPICE_BRUSH_TYPE_PATTERN
Brush SpiceBrush
MASK_INVERS SPICE_MASK_FLAGS_INVERS
QMask SpiceQMask
Fill SpiceFill
Palette SpicePalette
IMAGE_TYPE_BITMAP SPICE_IMAGE_TYPE_BITMAP
IMAGE_TYPE_QUIC SPICE_IMAGE_TYPE_QUIC
IMAGE_TYPE_RESERVED SPICE_IMAGE_TYPE_RESERVED
IMAGE_TYPE_LZ_PLT SPICE_IMAGE_TYPE_LZ_PLT
IMAGE_TYPE_LZ_RGB SPICE_IMAGE_TYPE_LZ_RGB
IMAGE_TYPE_GLZ_RGB SPICE_IMAGE_TYPE_GLZ_RGB
IMAGE_TYPE_FROM_CACHE SPICE_IMAGE_TYPE_FROM_CACHE
IMAGE_CACHE_ME SPICE_IMAGE_FLAGS_CACHE_ME
ImageDescriptor SpiceImageDescriptor
BITMAP_FMT_INVALID SPICE_BITMAP_FMT_INVALID
BITMAP_FMT_1BIT_LE SPICE_BITMAP_FMT_1BIT_LE
BITMAP_FMT_1BIT_BE SPICE_BITMAP_FMT_1BIT_BE
BITMAP_FMT_4BIT_LE SPICE_BITMAP_FMT_4BIT_LE
BITMAP_FMT_4BIT_BE SPICE_BITMAP_FMT_4BIT_BE
BITMAP_FMT_8BIT SPICE_BITMAP_FMT_8BIT
BITMAP_FMT_16BIT SPICE_BITMAP_FMT_16BIT
BITMAP_FMT_24BIT SPICE_BITMAP_FMT_24BIT
BITMAP_FMT_32BIT SPICE_BITMAP_FMT_32BIT
BITMAP_FMT_RGBA SPICE_BITMAP_FMT_RGBA
BITMAP_PAL_CACHE_ME SPICE_BITMAP_FLAGS_PAL_CACHE_ME
BITMAP_PAL_FROM_CACHE SPICE_BITMAP_FLAGS_PAL_FROM_CACHE
BITMAP_TOP_DOWN SPICE_BITMAP_FLAGS_TOP_DOWN
Bitmap SpiceBitmap
BitmapImage SpiceBitmapImage
QUICData SpiceQUICData
QUICImage SpiceQUICImage
LZ_RGBImage SpiceLZRGBImage
LZ_RGBData SpiceLZRGBData
LZ_PLTData SpiceLZPLTData
LZ_PLTImage SpiceLZPLTImage
IMAGE_SCALE_INTERPOLATE SPICE_IMAGE_SCALE_MODE_INTERPOLATE
IMAGE_SCALE_NEAREST SPICE_IMAGE_SCALE_MODE_NEAREST
Opaque SpiceOpaque
Copy SpiceCopy
Blend SpiceBlend
Transparent SpiceTransparent
AlphaBlnd SpiceAlphaBlnd
Rop3 SpiceRop3
Blackness SpiceBlackness
Invers SpiceInvers
Whiteness SpiceWhiteness
LINE_STYLED SPICE_LINE_FLAGS_STYLED
LINE_START_WITH_GAP SPICE_LINE_FLAGS_START_WITH_GAP
LINE_CAP_ROUND SPICE_LINE_CAP_ROUND
LINE_CAP_SQUARE SPICE_LINE_CAP_SQUARE
LINE_CAP_BUTT SPICE_LINE_CAP_BUTT
LINE_JOIN_ROUND SPICE_LINE_JOIN_ROUND
LINE_JOIN_BEVEL SPICE_LINE_JOIN_BEVEL
LINE_JOIN_MITER SPICE_LINE_JOIN_MITER
LineAttr SpiceLineAttr
Stroke SpiceStroke
RasterGlyph SpiceRasterGlyph
VectotGlyph SpiceVectorGlyph
STRING_RASTER_A1 SPICE_STRING_FLAGS_RASTER_A1
STRING_RASTER_A4 SPICE_STRING_FLAGS_RASTER_A4
STRING_RASTER_A8 SPICE_STRING_FLAGS_RASTER_A8
STRING_RASTER_TOP_DOWN SPICE_STRING_FLAGS_RASTER_TOP_DOWN
String SpiceString
Text SpiceText
CURSOR_TYPE_ALPHA SPICE_CURSOR_TYPE_ALPHA
CURSOR_TYPE_MONO SPICE_CURSOR_TYPE_MONO
CURSOR_TYPE_COLOR4 SPICE_CURSOR_TYPE_COLOR4
CURSOR_TYPE_COLOR8 SPICE_CURSOR_TYPE_COLOR8
CURSOR_TYPE_COLOR16 SPICE_CURSOR_TYPE_COLOR16
CURSOR_TYPE_COLOR24 SPICE_CURSOR_TYPE_COLOR24
CURSOR_TYPE_COLOR32 SPICE_CURSOR_TYPE_COLOR32
CursorHeader SpiceCursorHeader
ROPD_INVERS_SRC SPICE_ROPD_INVERS_SRC
ROPD_INVERS_BRUSH SPICE_ROPD_INVERS_BRUSH
ROPD_INVERS_DEST SPICE_ROPD_INVERS_DEST
ROPD_OP_PUT SPICE_ROPD_OP_PUT
ROPD_OP_OR SPICE_ROPD_OP_OR
ROPD_OP_AND SPICE_ROPD_OP_AND
ROPD_OP_XOR SPICE_ROPD_OP_XOR
ROPD_OP_BLACKNESS SPICE_ROPD_OP_BLACKNESS
ROPD_OP_WHITENESS SPICE_ROPD_OP_WHITENESS
ROPD_OP_INVERS SPICE_ROPD_OP_INVERS
ROPD_INVERS_RES SPICE_ROPD_INVERS_RES
RING_DECLARE SPICE_RING_DECLARE
RING_INIT SPICE_RING_INIT
RING_INDEX_MASK SPICE_RING_INDEX_MASK
RING_IS_PACKED SPICE_RING_IS_PACKED
RING_IS_EMPTY SPICE_RING_IS_EMPTY
RING_IS_FULL SPICE_RING_IS_FULL
RING_PROD_ITEM SPICE_RING_PROD_ITEM
RING_PROD_WAIT SPICE_RING_PROD_WAIT
RING_PUSH SPICE_RING_PUSH
RING_CONS_ITEM SPICE_RING_CONS_ITEM
RING_CONS_WAIT SPICE_RING_CONS_WAIT
RING_POP SPICE_RING_POP
PHYSICAL QXLPHYSICAL
REDS_STAT_SHM_NAME SPICE_STAT_SHM_NAME
REDS_STAT_NODE_NAME_MAX_LENGTH SPICE_STAT_NODE_NAME_MAX
REDS_STAT_MAGIC SPICE_STAT_MAGIC
REDS_STAT_VERSION SPICE_STAT_VERSION
STAT_NODE_FLAG_ENABLED SPICE_STAT_NODE_FLAG_ENABLED
STAT_NODE_FLAG_VISIBLE SPICE_STAT_NODE_FLAG_VISIBLE
STAT_NODE_FLAG_VALUE SPICE_STAT_NODE_FLAG_VALUE
STAT_NODE_MASK_SHOW SPICE_STAT_NODE_MASK_SHOW
STAT_NODE_MASK_SHOW_VALUE SPICE_STAT_NODE_MASK_SHOW_VALUE
StatNode SpiceStatNode
RedsStat SpiceStat

View File

@ -1,9 +0,0 @@
prefix=@prefix@
includedir=@includedir@
Name: spice-protocol
Description: SPICE protocol headers
Version: @VERSION@
Libs:
Cflags: -I${includedir}/spice-1

207
spice-protocol.spec Normal file
View File

@ -0,0 +1,207 @@
Name: spice-protocol
Version: 0.14.5
Release: 1%{?dist}
Summary: Spice protocol header files
Group: Development/Libraries
License: BSD
URL: https://www.spice-space.org
Source0: https://www.spice-space.org/download/releases/%{name}-%{version}.tar.xz
BuildArch: noarch
BuildRequires: meson gcc
BuildRequires: mingw32-filesystem >= 95
BuildRequires: mingw64-filesystem >= 95
%define desc Header files describing the spice protocol \
and the para-virtual graphics card QXL.
%description
%{desc}
%package -n mingw32-spice-protocol
Summary: %{summary}
Requires: mingw32-pkg-config
%description -n mingw32-spice-protocol
%{desc}
%package -n mingw64-spice-protocol
Summary: %{summary}
Requires: mingw64-pkg-config
%description -n mingw64-spice-protocol
%{desc}
%prep
%setup -q
%build
%meson
%meson_build
%mingw_meson
%mingw_ninja
%install
%meson_install
export DESTDIR=%{buildroot}
%mingw_ninja install
%files
%doc COPYING CHANGELOG.md
%{_includedir}/spice-1
%{_datadir}/pkgconfig/spice-protocol.pc
%files -n mingw32-spice-protocol
%doc COPYING CHANGELOG.md
%{mingw32_includedir}/spice-1
%{mingw32_datadir}/pkgconfig/spice-protocol.pc
%files -n mingw64-spice-protocol
%doc COPYING CHANGELOG.md
%{mingw64_includedir}/spice-1
%{mingw64_datadir}/pkgconfig/spice-protocol.pc
%changelog
* Fri Apr 12 2019 Victor Toso <victortoso@redhat.com> - 0.14.0-1
- Update to 0.14.0 release
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.15-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
* Mon Jan 14 2019 Marc-André Lureau <marcandre.lureau@redhat.com> - 0.12.15-1
- Update to 0.12.15 release
* Fri Jul 13 2018 Victor Toso <victortoso@redhat.com> - 0.12.14-2
- Align QXLRam to 4 bytes to avoid compilers detect misaligned access
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1565766
* Thu Jun 07 2018 Christophe Fergeau <cfergeau@redhat.com> - 0.12.14-1
- Update to 0.12.14 release
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.13-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.13-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
* Wed Jul 12 2017 Marc-André Lureau <marcandre.lureau@redhat.com> - 0.12.13-1
- Update to 0.12.13 release
* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.12-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
* Fri Aug 05 2016 Christophe Fergeau <cfergeau@redhat.com> - 0.12.12-1
- Update to 0.12.12 release
* Fri Mar 11 2016 Marc-André Lureau <marcandre.lureau@redhat.com> - 0.12.11-1
- Update to 0.12.11 release
* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.12.10-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
* Thu Oct 01 2015 Christophe Fergeau <cfergeau@redhat.com> 0.12.10-1
- Update to 0.12.10 - Add python scripts and .proto files used
to generate spice-gtk/spice-server marshalling C code
* Wed Jul 29 2015 Christophe Fergeau <cfergeau@redhat.com> 0.12.9-1
- Update to 0.12.9 - Fixes QEMU build failures when using 0.12.8 with
spice-server 0.12.5
* Tue Jun 30 2015 Christophe Fergeau <cfergeau@redhat.com> 0.12.8-1
- Update to 0.12.8
* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12.7-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12.7-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
* Mon May 19 2014 Christophe Fergeau <cfergeau@redhat.com> 0.12.7-1
- Update to 0.12.7
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.12.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
* Wed Jul 3 2013 Hans de Goede <hdegoede@redhat.com> - 0.12.6-1
- Update to 0.12.6
* Thu Mar 7 2013 Hans de Goede <hdegoede@redhat.com> - 0.12.5-1
- Update to 0.12.5
* Fri Feb 1 2013 Marc-André Lureau <marcandre.lureau@redhat.com> - 0.12.4-1
- Update to 0.12.4
* Thu Dec 20 2012 Hans de Goede <hdegoede@redhat.com> - 0.12.3-1
- Update to 0.12.3
* Fri Sep 28 2012 Hans de Goede <hdegoede@redhat.com> - 0.12.2-1
- Update to 0.12.2
* Thu Sep 6 2012 Soren Sandmann <ssp@redhat.com> - 0.12.1-1
- Add patch1 and patch2 to support capability bits
* Thu Sep 6 2012 Soren Sandmann <ssp@redhat.com> - 0.12.1-1
- Update to 0.12.1
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
* Mon Jan 16 2012 Hans de Goede <hdegoede@redhat.com> - 0.10.1-1
- Update to 0.10.1
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.10.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Sun Nov 13 2011 Alon Levy <alevy@redhat.com> - 0.10.0-1
- Update to 0.10.0
* Sun Oct 23 2011 Alon Levy <alevy@redhat.com> - 0.9.1-1
- Update to 0.9.1
* Thu Aug 25 2011 Hans de Goede <hdegoede@redhat.com> - 0.9.0-1
- Update to 0.9.0
* Mon Jul 25 2011 Marc-André Lureau <marcandre.lureau@redhat.com> - 0.8.1-2
- Added spice-protocol-0.8.1-define-INLINE.patch
* Tue Jul 19 2011 Marc-André Lureau <marcandre.lureau@redhat.com> - 0.8.1-1
- Update to 0.8.1
* Tue Mar 1 2011 Hans de Goede <hdegoede@redhat.com> - 0.8.0-1
- Update to 0.8.0
* Fri Feb 11 2011 Hans de Goede <hdegoede@redhat.com> - 0.7.1-1
- Update to 0.7.1
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.7.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Wed Jan 12 2011 Hans de Goede <hdegoede@redhat.com> - 0.7.0-2
- Update License tag (controller and foreign menu headers are LGPL)
* Fri Dec 17 2010 Hans de Goede <hdegoede@redhat.com> - 0.7.0-1
- Update to 0.7.0
* Mon Oct 18 2010 Hans de Goede <hdegoede@redhat.com> - 0.6.3-1
- Update to 0.6.3
* Thu Sep 30 2010 Gerd Hoffmann <kraxel@redhat.com> - 0.6.1-1
- Update to 0.6.1.
* Tue Aug 31 2010 Alexander Larsson <alexl@redhat.com> - 0.6.0-1
- Update to 0.6.0 (stable release)
* Tue Jul 20 2010 Alexander Larsson <alexl@redhat.com> - 0.5.3-1
- Update to 0.5.3
* Mon Jul 12 2010 Gerd Hoffmann <kraxel@redhat.com> - 0.5.2-2
- Fix license: It is BSD, not GPL.
- Cleanup specfile, drop bits not needed any more with
recent rpm versions (F13+).
* Fri Jul 9 2010 Gerd Hoffmann <kraxel@redhat.com> - 0.5.2-1
- initial package.

View File

@ -1,19 +0,0 @@
NULL =
spice_protocol_includedir=$(includedir)/spice-1/spice
spice_protocol_include_HEADERS= \
barrier.h \
end-packed.h \
enums.h \
error_codes.h \
ipc_ring.h \
protocol.h \
macros.h \
qxl_dev.h \
start-packed.h \
stats.h \
types.h \
vd_agent.h \
vdi_dev.h \
$(NULL)

View File

@ -33,14 +33,18 @@
#define _H_SPICE_BARRIER
#ifdef __GNUC__
#ifdef __i386__
#define spice_mb() __asm__ __volatile__ ("lock; addl $0,0(%%esp)": : :"memory")
#define spice_mb() __sync_synchronize ()
#else
//mfence
#define spice_mb() __asm__ __volatile__ ("lock; addl $0,0(%%rsp)": : :"memory")
#endif
#ifdef _WIN64
//__asm not supported on _WIN64, so use macro instead.
#define spice_mb MemoryBarrier
#else
#define spice_mb() __asm {lock add [esp], 0}
#endif
#endif
#endif /* _H_SPICE_BARRIER */

View File

@ -32,9 +32,8 @@
/* See start-packed.h for details */
#undef SPICE_ATTR_PACKED
#undef SPICE_ATTR_ALIGNED
#ifndef __GNUC__
#if defined(__MINGW32__) || !defined(__GNUC__)
#pragma pack(pop)
#endif

View File

@ -1,9 +1,40 @@
/* this is a file autogenerated by spice_codegen.py */
/*
Copyright (C) 2013 Red Hat, Inc.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _H_SPICE_ENUMS
#define _H_SPICE_ENUMS
/* Generated from spice.proto, don't edit */
#include <spice/macros.h>
enum SpiceLinkErr {
typedef enum SpiceLinkErr {
SPICE_LINK_ERR_OK,
SPICE_LINK_ERR_ERROR,
SPICE_LINK_ERR_INVALID_MAGIC,
@ -16,108 +47,143 @@ enum SpiceLinkErr {
SPICE_LINK_ERR_CHANNEL_NOT_AVAILABLE,
SPICE_LINK_ERR_ENUM_END
};
} SpiceLinkErr;
enum SpiceWarnCode {
typedef enum SpiceWarnCode {
SPICE_WARN_GENERAL,
SPICE_WARN_CODE_ENUM_END
};
} SpiceWarnCode;
enum SpiceInfoCode {
typedef enum SpiceInfoCode {
SPICE_INFO_GENERAL,
SPICE_INFO_CODE_ENUM_END
};
} SpiceInfoCode;
enum SpiceMigrateFlags {
typedef enum SpiceMigrateFlags {
SPICE_MIGRATE_NEED_FLUSH = (1 << 0),
SPICE_MIGRATE_NEED_DATA_TRANSFER = (1 << 1),
SPICE_MIGRATE_FLAGS_MASK = 0x3
};
} SpiceMigrateFlags;
enum SpiceNotifySeverity {
typedef enum SpiceCompositeFlags {
SPICE_COMPOSITE_OP0 = (1 << 0),
SPICE_COMPOSITE_OP1 = (1 << 1),
SPICE_COMPOSITE_OP2 = (1 << 2),
SPICE_COMPOSITE_OP3 = (1 << 3),
SPICE_COMPOSITE_OP4 = (1 << 4),
SPICE_COMPOSITE_OP5 = (1 << 5),
SPICE_COMPOSITE_OP6 = (1 << 6),
SPICE_COMPOSITE_OP7 = (1 << 7),
SPICE_COMPOSITE_SRC_FILTER0 = (1 << 8),
SPICE_COMPOSITE_SRC_FILTER1 = (1 << 9),
SPICE_COMPOSITE_SRC_FILTER2 = (1 << 10),
SPICE_COMPOSITE_MASK_FILTER0 = (1 << 11),
SPICE_COMPOSITE_MASK_FITLER1 = (1 << 12),
SPICE_COMPOSITE_MASK_FILTER2 = (1 << 13),
SPICE_COMPOSITE_SRC_REPEAT0 = (1 << 14),
SPICE_COMPOSITE_SRC_REPEAT1 = (1 << 15),
SPICE_COMPOSITE_MASK_REPEAT0 = (1 << 16),
SPICE_COMPOSITE_MASK_REPEAT1 = (1 << 17),
SPICE_COMPOSITE_COMPONENT_ALPHA = (1 << 18),
SPICE_COMPOSITE_HAS_MASK = (1 << 19),
SPICE_COMPOSITE_HAS_SRC_TRANSFORM = (1 << 20),
SPICE_COMPOSITE_HAS_MASK_TRANSFORM = (1 << 21),
SPICE_COMPOSITE_SOURCE_OPAQUE = (1 << 22),
SPICE_COMPOSITE_MASK_OPAQUE = (1 << 23),
SPICE_COMPOSITE_DEST_OPAQUE = (1 << 24),
SPICE_COMPOSITE_FLAGS_MASK = 0x1ffffff
} SpiceCompositeFlags;
typedef enum SpiceNotifySeverity {
SPICE_NOTIFY_SEVERITY_INFO,
SPICE_NOTIFY_SEVERITY_WARN,
SPICE_NOTIFY_SEVERITY_ERROR,
SPICE_NOTIFY_SEVERITY_ENUM_END
};
} SpiceNotifySeverity;
enum SpiceNotifyVisibility {
typedef enum SpiceNotifyVisibility {
SPICE_NOTIFY_VISIBILITY_LOW,
SPICE_NOTIFY_VISIBILITY_MEDIUM,
SPICE_NOTIFY_VISIBILITY_HIGH,
SPICE_NOTIFY_VISIBILITY_ENUM_END
};
} SpiceNotifyVisibility;
enum SpiceMouseMode {
typedef enum SpiceMouseMode {
SPICE_MOUSE_MODE_SERVER = (1 << 0),
SPICE_MOUSE_MODE_CLIENT = (1 << 1),
SPICE_MOUSE_MODE_MASK = 0x3
};
} SpiceMouseMode;
enum SpicePubkeyType {
SPICE_PUBKEY_TYPE_INVALID,
SPICE_PUBKEY_TYPE_RSA,
SPICE_PUBKEY_TYPE_RSA2,
SPICE_PUBKEY_TYPE_DSA,
SPICE_PUBKEY_TYPE_DSA1,
SPICE_PUBKEY_TYPE_DSA2,
SPICE_PUBKEY_TYPE_DSA3,
SPICE_PUBKEY_TYPE_DSA4,
SPICE_PUBKEY_TYPE_DH,
SPICE_PUBKEY_TYPE_EC,
typedef enum SpiceDataCompressionType {
SPICE_DATA_COMPRESSION_TYPE_NONE,
SPICE_DATA_COMPRESSION_TYPE_LZ4,
SPICE_PUBKEY_TYPE_ENUM_END
};
SPICE_DATA_COMPRESSION_TYPE_ENUM_END
} SpiceDataCompressionType;
enum SpiceClipType {
typedef enum SpiceClipType {
SPICE_CLIP_TYPE_NONE,
SPICE_CLIP_TYPE_RECTS,
SPICE_CLIP_TYPE_ENUM_END
};
} SpiceClipType;
enum SpicePathFlags {
typedef enum SpicePathFlags {
SPICE_PATH_BEGIN = (1 << 0),
SPICE_PATH_END = (1 << 1),
SPICE_PATH_CLOSE = (1 << 3),
SPICE_PATH_BEZIER = (1 << 4),
SPICE_PATH_FLAGS_MASK = 0x1b
};
} SpicePathFlags;
enum SpiceVideoCodecType {
typedef enum SpiceVideoCodecType {
SPICE_VIDEO_CODEC_TYPE_MJPEG = 1,
SPICE_VIDEO_CODEC_TYPE_VP8,
SPICE_VIDEO_CODEC_TYPE_H264,
SPICE_VIDEO_CODEC_TYPE_VP9,
SPICE_VIDEO_CODEC_TYPE_H265,
SPICE_VIDEO_CODEC_TYPE_AV1,
SPICE_VIDEO_CODEC_TYPE_H264_444,
SPICE_VIDEO_CODEC_TYPE_VP9_444,
SPICE_VIDEO_CODEC_TYPE_H265_444,
SPICE_VIDEO_CODEC_TYPE_AV1_444,
SPICE_VIDEO_CODEC_TYPE_H264_U,
SPICE_VIDEO_CODEC_TYPE_VP9_U,
SPICE_VIDEO_CODEC_TYPE_H265_U,
SPICE_VIDEO_CODEC_TYPE_AV1_U,
SPICE_VIDEO_CODEC_TYPE_ENUM_END
};
} SpiceVideoCodecType;
enum SpiceStreamFlags {
typedef enum SpiceStreamFlags {
SPICE_STREAM_FLAGS_TOP_DOWN = (1 << 0),
SPICE_STREAM_FLAGS_MASK = 0x1
};
} SpiceStreamFlags;
enum SpiceBrushType {
typedef enum SpiceBrushType {
SPICE_BRUSH_TYPE_NONE,
SPICE_BRUSH_TYPE_SOLID,
SPICE_BRUSH_TYPE_PATTERN,
SPICE_BRUSH_TYPE_ENUM_END
};
} SpiceBrushType;
enum SpiceMaskFlags {
typedef enum SpiceMaskFlags {
SPICE_MASK_FLAGS_INVERS = (1 << 0),
SPICE_MASK_FLAGS_MASK = 0x1
};
} SpiceMaskFlags;
enum SpiceImageType {
typedef enum SpiceImageType {
SPICE_IMAGE_TYPE_BITMAP,
SPICE_IMAGE_TYPE_QUIC,
SPICE_IMAGE_TYPE_RESERVED,
@ -130,19 +196,33 @@ enum SpiceImageType {
SPICE_IMAGE_TYPE_FROM_CACHE_LOSSLESS,
SPICE_IMAGE_TYPE_ZLIB_GLZ_RGB,
SPICE_IMAGE_TYPE_JPEG_ALPHA,
SPICE_IMAGE_TYPE_LZ4,
SPICE_IMAGE_TYPE_ENUM_END
};
} SpiceImageType;
enum SpiceImageFlags {
typedef enum SpiceImageCompression {
SPICE_IMAGE_COMPRESSION_INVALID,
SPICE_IMAGE_COMPRESSION_OFF,
SPICE_IMAGE_COMPRESSION_AUTO_GLZ,
SPICE_IMAGE_COMPRESSION_AUTO_LZ,
SPICE_IMAGE_COMPRESSION_QUIC,
SPICE_IMAGE_COMPRESSION_GLZ,
SPICE_IMAGE_COMPRESSION_LZ,
SPICE_IMAGE_COMPRESSION_LZ4,
SPICE_IMAGE_COMPRESSION_ENUM_END
} SpiceImageCompression;
typedef enum SpiceImageFlags {
SPICE_IMAGE_FLAGS_CACHE_ME = (1 << 0),
SPICE_IMAGE_FLAGS_HIGH_BITS_SET = (1 << 1),
SPICE_IMAGE_FLAGS_CACHE_REPLACE_ME = (1 << 2),
SPICE_IMAGE_FLAGS_MASK = 0x7
};
} SpiceImageFlags;
enum SpiceBitmapFmt {
typedef enum SpiceBitmapFmt {
SPICE_BITMAP_FMT_INVALID,
SPICE_BITMAP_FMT_1BIT_LE,
SPICE_BITMAP_FMT_1BIT_BE,
@ -153,32 +233,33 @@ enum SpiceBitmapFmt {
SPICE_BITMAP_FMT_24BIT,
SPICE_BITMAP_FMT_32BIT,
SPICE_BITMAP_FMT_RGBA,
SPICE_BITMAP_FMT_8BIT_A,
SPICE_BITMAP_FMT_ENUM_END
};
} SpiceBitmapFmt;
enum SpiceBitmapFlags {
typedef enum SpiceBitmapFlags {
SPICE_BITMAP_FLAGS_PAL_CACHE_ME = (1 << 0),
SPICE_BITMAP_FLAGS_PAL_FROM_CACHE = (1 << 1),
SPICE_BITMAP_FLAGS_TOP_DOWN = (1 << 2),
SPICE_BITMAP_FLAGS_MASK = 0x7
};
} SpiceBitmapFlags;
enum SpiceJpegAlphaFlags {
typedef enum SpiceJpegAlphaFlags {
SPICE_JPEG_ALPHA_FLAGS_TOP_DOWN = (1 << 0),
SPICE_JPEG_ALPHA_FLAGS_MASK = 0x1
};
} SpiceJpegAlphaFlags;
enum SpiceImageScaleMode {
typedef enum SpiceImageScaleMode {
SPICE_IMAGE_SCALE_MODE_INTERPOLATE,
SPICE_IMAGE_SCALE_MODE_NEAREST,
SPICE_IMAGE_SCALE_MODE_ENUM_END
};
} SpiceImageScaleMode;
enum SpiceRopd {
typedef enum SpiceRopd {
SPICE_ROPD_INVERS_SRC = (1 << 0),
SPICE_ROPD_INVERS_BRUSH = (1 << 1),
SPICE_ROPD_INVERS_DEST = (1 << 2),
@ -192,31 +273,32 @@ enum SpiceRopd {
SPICE_ROPD_INVERS_RES = (1 << 10),
SPICE_ROPD_MASK = 0x7ff
};
} SpiceRopd;
enum SpiceLineFlags {
typedef enum SpiceLineFlags {
SPICE_LINE_FLAGS_START_WITH_GAP = (1 << 2),
SPICE_LINE_FLAGS_STYLED = (1 << 3),
SPICE_LINE_FLAGS_MASK = 0xc
};
} SpiceLineFlags;
enum SpiceStringFlags {
typedef enum SpiceStringFlags {
SPICE_STRING_FLAGS_RASTER_A1 = (1 << 0),
SPICE_STRING_FLAGS_RASTER_A4 = (1 << 1),
SPICE_STRING_FLAGS_RASTER_A8 = (1 << 2),
SPICE_STRING_FLAGS_RASTER_TOP_DOWN = (1 << 3),
SPICE_STRING_FLAGS_MASK = 0xf
};
} SpiceStringFlags;
enum SpiceSurfaceFlags {
typedef enum SpiceSurfaceFlags {
SPICE_SURFACE_FLAGS_PRIMARY = (1 << 0),
SPICE_SURFACE_FLAGS_STREAMING_MODE = (1 << 1),
SPICE_SURFACE_FLAGS_MASK = 0x1
};
SPICE_SURFACE_FLAGS_MASK = 0x3
} SpiceSurfaceFlags;
enum SpiceSurfaceFmt {
typedef enum SpiceSurfaceFmt {
SPICE_SURFACE_FMT_INVALID,
SPICE_SURFACE_FMT_1_A,
SPICE_SURFACE_FMT_8_A = 8,
@ -226,50 +308,62 @@ enum SpiceSurfaceFmt {
SPICE_SURFACE_FMT_32_ARGB = 96,
SPICE_SURFACE_FMT_ENUM_END
};
} SpiceSurfaceFmt;
enum SpiceAlphaFlags {
typedef enum SpiceAlphaFlags {
SPICE_ALPHA_FLAGS_DEST_HAS_ALPHA = (1 << 0),
SPICE_ALPHA_FLAGS_SRC_SURFACE_HAS_ALPHA = (1 << 1),
SPICE_ALPHA_FLAGS_MASK = 0x3
};
} SpiceAlphaFlags;
enum SpiceResourceType {
typedef enum SpiceResourceType {
SPICE_RES_TYPE_INVALID,
SPICE_RES_TYPE_PIXMAP,
SPICE_RESOURCE_TYPE_ENUM_END
};
} SpiceResourceType;
enum SpiceKeyboardModifierFlags {
typedef enum SpiceGlScanoutFlags {
SPICE_GL_SCANOUT_FLAGS_Y0TOP = (1 << 0),
SPICE_GL_SCANOUT_FLAGS_MASK = 0x1
} SpiceGlScanoutFlags;
typedef enum SpiceKeyboardModifierFlags {
SPICE_KEYBOARD_MODIFIER_FLAGS_SCROLL_LOCK = (1 << 0),
SPICE_KEYBOARD_MODIFIER_FLAGS_NUM_LOCK = (1 << 1),
SPICE_KEYBOARD_MODIFIER_FLAGS_CAPS_LOCK = (1 << 2),
SPICE_KEYBOARD_MODIFIER_FLAGS_MASK = 0x7
};
} SpiceKeyboardModifierFlags;
enum SpiceMouseButton {
typedef enum SpiceMouseButton {
SPICE_MOUSE_BUTTON_INVALID,
SPICE_MOUSE_BUTTON_LEFT,
SPICE_MOUSE_BUTTON_MIDDLE,
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;
enum SpiceMouseButtonMask {
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 = 0x7
};
SPICE_MOUSE_BUTTON_MASK_MASK = 0x7F
} SpiceMouseButtonMask;
enum SpiceCursorType {
typedef enum SpiceCursorType {
SPICE_CURSOR_TYPE_ALPHA,
SPICE_CURSOR_TYPE_MONO,
SPICE_CURSOR_TYPE_COLOR4,
@ -279,45 +373,45 @@ enum SpiceCursorType {
SPICE_CURSOR_TYPE_COLOR32,
SPICE_CURSOR_TYPE_ENUM_END
};
} SpiceCursorType;
enum SpiceCursorFlags {
typedef enum SpiceCursorFlags {
SPICE_CURSOR_FLAGS_NONE = (1 << 0),
SPICE_CURSOR_FLAGS_CACHE_ME = (1 << 1),
SPICE_CURSOR_FLAGS_FROM_CACHE = (1 << 2),
SPICE_CURSOR_FLAGS_MASK = 0x7
};
} SpiceCursorFlags;
enum SpiceAudioDataMode {
typedef enum SpiceAudioDataMode {
SPICE_AUDIO_DATA_MODE_INVALID,
SPICE_AUDIO_DATA_MODE_RAW,
SPICE_AUDIO_DATA_MODE_CELT_0_5_1,
SPICE_AUDIO_DATA_MODE_CELT_0_5_1 SPICE_GNUC_DEPRECATED_ENUMERATOR,
SPICE_AUDIO_DATA_MODE_OPUS,
SPICE_AUDIO_DATA_MODE_ENUM_END
};
} SpiceAudioDataMode;
enum SpiceAudioFmt {
typedef enum SpiceAudioFmt {
SPICE_AUDIO_FMT_INVALID,
SPICE_AUDIO_FMT_S16,
SPICE_AUDIO_FMT_ENUM_END
};
} SpiceAudioFmt;
enum SpiceTunnelServiceType {
SPICE_TUNNEL_SERVICE_TYPE_INVALID,
SPICE_TUNNEL_SERVICE_TYPE_GENERIC,
SPICE_TUNNEL_SERVICE_TYPE_IPP,
typedef enum SpiceVscMessageType {
SPICE_VSC_MESSAGE_TYPE_Init = 1,
SPICE_VSC_MESSAGE_TYPE_Error,
SPICE_VSC_MESSAGE_TYPE_ReaderAdd,
SPICE_VSC_MESSAGE_TYPE_ReaderRemove,
SPICE_VSC_MESSAGE_TYPE_ATR,
SPICE_VSC_MESSAGE_TYPE_CardRemove,
SPICE_VSC_MESSAGE_TYPE_APDU,
SPICE_VSC_MESSAGE_TYPE_Flush,
SPICE_VSC_MESSAGE_TYPE_FlushComplete,
SPICE_TUNNEL_SERVICE_TYPE_ENUM_END
};
enum SpiceTunnelIpType {
SPICE_TUNNEL_IP_TYPE_INVALID,
SPICE_TUNNEL_IP_TYPE_IPv4,
SPICE_TUNNEL_IP_TYPE_ENUM_END
};
SPICE_VSC_MESSAGE_TYPE_ENUM_END
} SpiceVscMessageType;
enum {
SPICE_CHANNEL_MAIN = 1,
@ -327,6 +421,10 @@ enum {
SPICE_CHANNEL_PLAYBACK,
SPICE_CHANNEL_RECORD,
SPICE_CHANNEL_TUNNEL,
SPICE_CHANNEL_SMARTCARD,
SPICE_CHANNEL_USBREDIR,
SPICE_CHANNEL_PORT,
SPICE_CHANNEL_WEBDAV,
SPICE_END_CHANNEL
};
@ -339,6 +437,8 @@ enum {
SPICE_MSG_WAIT_FOR_CHANNELS,
SPICE_MSG_DISCONNECTING,
SPICE_MSG_NOTIFY,
SPICE_MSG_LIST,
SPICE_MSG_BASE_LAST = 100,
};
enum {
@ -362,6 +462,13 @@ enum {
SPICE_MSG_MAIN_AGENT_DATA,
SPICE_MSG_MAIN_AGENT_TOKEN,
SPICE_MSG_MAIN_MIGRATE_SWITCH_HOST,
SPICE_MSG_MAIN_MIGRATE_END,
SPICE_MSG_MAIN_NAME,
SPICE_MSG_MAIN_UUID,
SPICE_MSG_MAIN_AGENT_CONNECTED_TOKENS,
SPICE_MSG_MAIN_MIGRATE_BEGIN_SEAMLESS,
SPICE_MSG_MAIN_MIGRATE_DST_SEAMLESS_ACK,
SPICE_MSG_MAIN_MIGRATE_DST_SEAMLESS_NACK,
SPICE_MSG_END_MAIN
};
@ -375,6 +482,10 @@ enum {
SPICE_MSGC_MAIN_AGENT_START,
SPICE_MSGC_MAIN_AGENT_DATA,
SPICE_MSGC_MAIN_AGENT_TOKEN,
SPICE_MSGC_MAIN_MIGRATE_END,
SPICE_MSGC_MAIN_MIGRATE_DST_DO_SEAMLESS,
SPICE_MSGC_MAIN_MIGRATE_CONNECTED_SEAMLESS,
SPICE_MSGC_MAIN_QUALITY_INDICATOR,
SPICE_MSGC_END_MAIN
};
@ -407,12 +518,24 @@ enum {
SPICE_MSG_DISPLAY_DRAW_ALPHA_BLEND,
SPICE_MSG_DISPLAY_SURFACE_CREATE,
SPICE_MSG_DISPLAY_SURFACE_DESTROY,
SPICE_MSG_DISPLAY_STREAM_DATA_SIZED,
SPICE_MSG_DISPLAY_MONITORS_CONFIG,
SPICE_MSG_DISPLAY_DRAW_COMPOSITE,
SPICE_MSG_DISPLAY_STREAM_ACTIVATE_REPORT,
SPICE_MSG_DISPLAY_GL_SCANOUT_UNIX,
SPICE_MSG_DISPLAY_GL_DRAW,
SPICE_MSG_DISPLAY_QUALITY_INDICATOR,
SPICE_MSG_DISPLAY_GL_SCANOUT2_UNIX,
SPICE_MSG_END_DISPLAY
};
enum {
SPICE_MSGC_DISPLAY_INIT = 101,
SPICE_MSGC_DISPLAY_STREAM_REPORT,
SPICE_MSGC_DISPLAY_PREFERRED_COMPRESSION,
SPICE_MSGC_DISPLAY_GL_DRAW_DONE,
SPICE_MSGC_DISPLAY_PREFERRED_VIDEO_CODEC_TYPE,
SPICE_MSGC_END_DISPLAY
};
@ -429,6 +552,7 @@ enum {
SPICE_MSGC_INPUTS_KEY_DOWN = 101,
SPICE_MSGC_INPUTS_KEY_UP,
SPICE_MSGC_INPUTS_KEY_MODIFIERS,
SPICE_MSGC_INPUTS_KEY_SCANCODE,
SPICE_MSGC_INPUTS_MOUSE_MOTION = 111,
SPICE_MSGC_INPUTS_MOUSE_POSITION,
SPICE_MSGC_INPUTS_MOUSE_PRESS,
@ -455,6 +579,9 @@ enum {
SPICE_MSG_PLAYBACK_MODE,
SPICE_MSG_PLAYBACK_START,
SPICE_MSG_PLAYBACK_STOP,
SPICE_MSG_PLAYBACK_VOLUME,
SPICE_MSG_PLAYBACK_MUTE,
SPICE_MSG_PLAYBACK_LATENCY,
SPICE_MSG_END_PLAYBACK
};
@ -462,6 +589,8 @@ enum {
enum {
SPICE_MSG_RECORD_START = 101,
SPICE_MSG_RECORD_STOP,
SPICE_MSG_RECORD_VOLUME,
SPICE_MSG_RECORD_MUTE,
SPICE_MSG_END_RECORD
};
@ -475,30 +604,46 @@ enum {
};
enum {
SPICE_MSG_TUNNEL_INIT = 101,
SPICE_MSG_TUNNEL_SERVICE_IP_MAP,
SPICE_MSG_TUNNEL_SOCKET_OPEN,
SPICE_MSG_TUNNEL_SOCKET_FIN,
SPICE_MSG_TUNNEL_SOCKET_CLOSE,
SPICE_MSG_TUNNEL_SOCKET_DATA,
SPICE_MSG_TUNNEL_SOCKET_CLOSED_ACK,
SPICE_MSG_TUNNEL_SOCKET_TOKEN,
SPICE_MSG_SMARTCARD_DATA = 101,
SPICE_MSG_END_TUNNEL
SPICE_MSG_END_SMARTCARD
};
enum {
SPICE_MSGC_TUNNEL_SERVICE_ADD = 101,
SPICE_MSGC_TUNNEL_SERVICE_REMOVE,
SPICE_MSGC_TUNNEL_SOCKET_OPEN_ACK,
SPICE_MSGC_TUNNEL_SOCKET_OPEN_NACK,
SPICE_MSGC_TUNNEL_SOCKET_FIN,
SPICE_MSGC_TUNNEL_SOCKET_CLOSED,
SPICE_MSGC_TUNNEL_SOCKET_CLOSED_ACK,
SPICE_MSGC_TUNNEL_SOCKET_DATA,
SPICE_MSGC_TUNNEL_SOCKET_TOKEN,
SPICE_MSGC_SMARTCARD_DATA = 101,
SPICE_MSGC_SMARTCARD_HEADER = 101,
SPICE_MSGC_SMARTCARD_ERROR = 101,
SPICE_MSGC_SMARTCARD_ATR = 101,
SPICE_MSGC_SMARTCARD_READER_ADD = 101,
SPICE_MSGC_END_TUNNEL
SPICE_MSGC_END_SMARTCARD
};
enum {
SPICE_MSG_SPICEVMC_DATA = 101,
SPICE_MSG_SPICEVMC_COMPRESSED_DATA,
SPICE_MSG_END_SPICEVMC
};
enum {
SPICE_MSGC_SPICEVMC_DATA = 101,
SPICE_MSGC_SPICEVMC_COMPRESSED_DATA,
SPICE_MSGC_END_SPICEVMC
};
enum {
SPICE_MSG_PORT_INIT = 201,
SPICE_MSG_PORT_EVENT,
SPICE_MSG_END_PORT
};
enum {
SPICE_MSGC_PORT_EVENT = 201,
SPICE_MSGC_END_PORT
};
#endif /* _H_SPICE_ENUMS */

View File

@ -1,51 +0,0 @@
/*
Copyright (C) 2009 Red Hat, Inc.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _H_SPICE_ERROR_CODES
#define _H_SPICE_ERROR_CODES
#define SPICEC_ERROR_CODE_SUCCESS 0
#define SPICEC_ERROR_CODE_ERROR 1
#define SPICEC_ERROR_CODE_GETHOSTBYNAME_FAILED 2
#define SPICEC_ERROR_CODE_CONNECT_FAILED 3
#define SPICEC_ERROR_CODE_SOCKET_FAILED 4
#define SPICEC_ERROR_CODE_SEND_FAILED 5
#define SPICEC_ERROR_CODE_RECV_FAILED 6
#define SPICEC_ERROR_CODE_SSL_ERROR 7
#define SPICEC_ERROR_CODE_NOT_ENOUGH_MEMORY 8
#define SPICEC_ERROR_CODE_AGENT_TIMEOUT 9
#define SPICEC_ERROR_CODE_AGENT_ERROR 10
#define SPICEC_ERROR_CODE_VERSION_MISMATCH 11
#define SPICEC_ERROR_CODE_PERMISSION_DENIED 12
#define SPICEC_ERROR_CODE_INVALID_ARG 13
#define SPICEC_ERROR_CODE_CMD_LINE_ERROR 14
#endif /* _H_SPICE_ERROR_CODES */

View File

@ -2,18 +2,18 @@
/*
Copyright (C) 2010 Red Hat, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
/* This file is to a large extent based on gmacros.h from glib
@ -34,20 +34,17 @@
#include <spice/types.h>
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
#define SPICE_GNUC_PURE __attribute__((__pure__))
#define SPICE_GNUC_MALLOC __attribute__((__malloc__))
#else
#define SPICE_GNUC_PURE
#define SPICE_GNUC_MALLOC
#endif
#if __GNUC__ >= 4
#define SPICE_GNUC_NULL_TERMINATED __attribute__((__sentinel__))
#else
#define SPICE_GNUC_NULL_TERMINATED
#ifndef __has_feature
#define __has_feature(x) 0 /* Compatibility with non-clang compilers. */
#endif
#if (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3)
#if (!defined(__clang__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))) || \
(defined(__clang__) && __has_feature(__alloc_size__))
#define SPICE_GNUC_ALLOC_SIZE(x) __attribute__((__alloc_size__(x)))
#define SPICE_GNUC_ALLOC_SIZE2(x,y) __attribute__((__alloc_size__(x,y)))
#else
@ -57,27 +54,31 @@
#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
#define SPICE_GNUC_PRINTF( format_idx, arg_idx ) __attribute__((__format__ (__printf__, format_idx, arg_idx)))
#define SPICE_GNUC_SCANF( format_idx, arg_idx ) __attribute__((__format__ (__scanf__, format_idx, arg_idx)))
#define SPICE_GNUC_FORMAT( arg_idx ) __attribute__((__format_arg__ (arg_idx)))
#define SPICE_GNUC_NORETURN __attribute__((__noreturn__))
#define SPICE_GNUC_CONST __attribute__((__const__))
#define SPICE_GNUC_UNUSED __attribute__((__unused__))
#define SPICE_GNUC_NO_INSTRUMENT __attribute__((__no_instrument_function__))
#else /* !__GNUC__ */
#define SPICE_GNUC_PRINTF( format_idx, arg_idx )
#define SPICE_GNUC_SCANF( format_idx, arg_idx )
#define SPICE_GNUC_FORMAT( arg_idx )
#define SPICE_GNUC_NORETURN
#define SPICE_GNUC_CONST
#define SPICE_GNUC_UNUSED
#define SPICE_GNUC_NO_INSTRUMENT
#endif /* !__GNUC__ */
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
#ifdef G_DEPRECATED
#define SPICE_GNUC_DEPRECATED G_DEPRECATED
#elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
#define SPICE_GNUC_DEPRECATED __attribute__((__deprecated__))
#elif defined(_MSC_VER) && (_MSC_VER >= 1300)
#define SPICE_GNUC_DEPRECATED __declspec(deprecated)
#else
#define SPICE_GNUC_DEPRECATED
#endif /* __GNUC__ */
#endif
#if ((defined(__GNUC__) && (__GNUC__ > 6 || (__GNUC__ == 6 && __GNUC_MINOR__ >= 1))) || \
(defined(__clang_major__) && (__clang_major__ > 3 || \
(__clang_major__ == 3 && __clang_minor__ >= 0))))
#define SPICE_GNUC_DEPRECATED_ENUMERATOR SPICE_GNUC_DEPRECATED
#else
#define SPICE_GNUC_DEPRECATED_ENUMERATOR
#endif
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
# define SPICE_GNUC_MAY_ALIAS __attribute__((may_alias))
@ -138,8 +139,19 @@
((long) ((uint8_t*) &((struct_type*) 0)->member))
#endif
/* The SPICE_USE_SAFER_CONTAINEROF macro is used to avoid
* compilation breakage with older spice-server releases which
* triggered some errors without an additional patch.
*/
#if defined(__GNUC__) && defined(SPICE_USE_SAFER_CONTAINEROF) && \
(__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#define SPICE_CONTAINEROF(ptr, struct_type, member) ({ \
const typeof( ((struct_type *)0)->member ) *__mptr = (ptr); \
((struct_type *)(void *)((uint8_t *)(__mptr) - SPICE_OFFSETOF(struct_type, member))); })
#else
#define SPICE_CONTAINEROF(ptr, struct_type, member) \
((struct_type *)((uint8_t *)(ptr) - SPICE_OFFSETOF(struct_type, member)))
((struct_type *)(void *)((uint8_t *)(ptr) - SPICE_OFFSETOF(struct_type, member)))
#endif
#define SPICE_MEMBER_P(struct_p, struct_offset) \
((gpointer) ((guint8*) (struct_p) + (glong) (struct_offset)))
@ -228,130 +240,14 @@
/* Arch specific stuff for speed
*/
#if defined (__GNUC__) && (__GNUC__ >= 2) && defined (__OPTIMIZE__)
# if defined (__i386__)
# define SPICE_BYTESWAP16_IA32(val) \
(__extension__ \
({ register uint16_t __v, __x = ((uint16_t) (val)); \
if (__builtin_constant_p (__x)) \
__v = SPICE_BYTESWAP16_CONSTANT (__x); \
else \
__asm__ ("rorw $8, %w0" \
: "=r" (__v) \
: "0" (__x) \
: "cc"); \
__v; }))
# if !defined (__i486__) && !defined (__i586__) \
&& !defined (__pentium__) && !defined (__i686__) \
&& !defined (__pentiumpro__) && !defined (__pentium4__)
# define SPICE_BYTESWAP32_IA32(val) \
(__extension__ \
({ register uint32_t __v, __x = ((uint32_t) (val)); \
if (__builtin_constant_p (__x)) \
__v = SPICE_BYTESWAP32_CONSTANT (__x); \
else \
__asm__ ("rorw $8, %w0\n\t" \
"rorl $16, %0\n\t" \
"rorw $8, %w0" \
: "=r" (__v) \
: "0" (__x) \
: "cc"); \
__v; }))
# else /* 486 and higher has bswap */
# define SPICE_BYTESWAP32_IA32(val) \
(__extension__ \
({ register uint32_t __v, __x = ((uint32_t) (val)); \
if (__builtin_constant_p (__x)) \
__v = SPICE_BYTESWAP32_CONSTANT (__x); \
else \
__asm__ ("bswap %0" \
: "=r" (__v) \
: "0" (__x)); \
__v; }))
# endif /* processor specific 32-bit stuff */
# define SPICE_BYTESWAP64_IA32(val) \
(__extension__ \
({ union { uint64_t __ll; \
uint32_t __l[2]; } __w, __r; \
__w.__ll = ((uint64_t) (val)); \
if (__builtin_constant_p (__w.__ll)) \
__r.__ll = SPICE_BYTESWAP64_CONSTANT (__w.__ll); \
else \
{ \
__r.__l[0] = SPICE_BYTESWAP32 (__w.__l[1]); \
__r.__l[1] = SPICE_BYTESWAP32 (__w.__l[0]); \
} \
__r.__ll; }))
/* Possibly just use the constant version and let gcc figure it out? */
# define SPICE_BYTESWAP16(val) (SPICE_BYTESWAP16_IA32 (val))
# define SPICE_BYTESWAP32(val) (SPICE_BYTESWAP32_IA32 (val))
# define SPICE_BYTESWAP64(val) (SPICE_BYTESWAP64_IA32 (val))
# elif defined (__ia64__)
# define SPICE_BYTESWAP16_IA64(val) \
(__extension__ \
({ register uint16_t __v, __x = ((uint16_t) (val)); \
if (__builtin_constant_p (__x)) \
__v = SPICE_BYTESWAP16_CONSTANT (__x); \
else \
__asm__ __volatile__ ("shl %0 = %1, 48 ;;" \
"mux1 %0 = %0, @rev ;;" \
: "=r" (__v) \
: "r" (__x)); \
__v; }))
# define SPICE_BYTESWAP32_IA64(val) \
(__extension__ \
({ register uint32_t __v, __x = ((uint32_t) (val)); \
if (__builtin_constant_p (__x)) \
__v = SPICE_BYTESWAP32_CONSTANT (__x); \
else \
__asm__ __volatile__ ("shl %0 = %1, 32 ;;" \
"mux1 %0 = %0, @rev ;;" \
: "=r" (__v) \
: "r" (__x)); \
__v; }))
# define SPICE_BYTESWAP64_IA64(val) \
(__extension__ \
({ register uint64_t __v, __x = ((uint64_t) (val)); \
if (__builtin_constant_p (__x)) \
__v = SPICE_BYTESWAP64_CONSTANT (__x); \
else \
__asm__ __volatile__ ("mux1 %0 = %1, @rev ;;" \
: "=r" (__v) \
: "r" (__x)); \
__v; }))
# define SPICE_BYTESWAP16(val) (SPICE_BYTESWAP16_IA64 (val))
# define SPICE_BYTESWAP32(val) (SPICE_BYTESWAP32_IA64 (val))
# define SPICE_BYTESWAP64(val) (SPICE_BYTESWAP64_IA64 (val))
# elif defined (__x86_64__)
# define SPICE_BYTESWAP32_X86_64(val) \
(__extension__ \
({ register uint32_t __v, __x = ((uint32_t) (val)); \
if (__builtin_constant_p (__x)) \
__v = SPICE_BYTESWAP32_CONSTANT (__x); \
else \
__asm__ ("bswapl %0" \
: "=r" (__v) \
: "0" (__x)); \
__v; }))
# define SPICE_BYTESWAP64_X86_64(val) \
(__extension__ \
({ register uint64_t __v, __x = ((uint64_t) (val)); \
if (__builtin_constant_p (__x)) \
__v = SPICE_BYTESWAP64_CONSTANT (__x); \
else \
__asm__ ("bswapq %0" \
: "=r" (__v) \
: "0" (__x)); \
__v; }))
/* gcc seems to figure out optimal code for this on its own */
# define SPICE_BYTESWAP16(val) (SPICE_BYTESWAP16_CONSTANT (val))
# define SPICE_BYTESWAP32(val) (SPICE_BYTESWAP32_X86_64 (val))
# define SPICE_BYTESWAP64(val) (SPICE_BYTESWAP64_X86_64 (val))
# else /* generic gcc */
# define SPICE_BYTESWAP16(val) (SPICE_BYTESWAP16_CONSTANT (val))
# define SPICE_BYTESWAP32(val) (SPICE_BYTESWAP32_CONSTANT (val))
# define SPICE_BYTESWAP64(val) (SPICE_BYTESWAP64_CONSTANT (val))
# endif
#if defined (__GNUC__) && (__GNUC__ >= 4) && defined (__OPTIMIZE__)
# define SPICE_BYTESWAP16(val) __builtin_bswap16(val)
# define SPICE_BYTESWAP32(val) __builtin_bswap32(val)
# define SPICE_BYTESWAP64(val) __builtin_bswap64(val)
#elif defined(_MSC_VER)
# define SPICE_BYTESWAP16(val) _byteswap_ushort(val)
# define SPICE_BYTESWAP32(val) _byteswap_ulong(val)
# define SPICE_BYTESWAP64(val) _byteswap_uint64(val)
#else /* generic */
# define SPICE_BYTESWAP16(val) (SPICE_BYTESWAP16_CONSTANT (val))
# define SPICE_BYTESWAP32(val) (SPICE_BYTESWAP32_CONSTANT (val))
@ -359,4 +255,69 @@
#endif /* generic */
/* detect endianness */
#undef SPICE_ENDIAN
#define SPICE_ENDIAN_LITTLE 4321
#define SPICE_ENDIAN_BIG 1234
#define SPICE_ENDIAN_PDP 2143
/* gcc already defined these, use them */
#if defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) \
&& defined(__ORDER_BIG_ENDIAN__) && defined(__ORDER_PDP_ENDIAN__)
# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
# define SPICE_ENDIAN SPICE_ENDIAN_LITTLE
# elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
# define SPICE_ENDIAN SPICE_ENDIAN_BIG
# elif __BYTE_ORDER__ == __ORDER_PDP_ENDIAN__
# define SPICE_ENDIAN SPICE_ENDIAN_PDP
# else
# error __BYTE_ORDER__ not defined correctly
# endif
#endif
/* use suggestions at http://sourceforge.net/p/predef/wiki/Endianness/ */
#ifndef SPICE_ENDIAN
# if defined(__LITTLE_ENDIAN__) || defined(__ARMEL__) \
|| defined(__THUMBEL__) || defined(__AARCH64EL__) \
|| defined(_MIPSEL) || defined(__MIPSEL) || defined(__MIPSEL__) \
|| defined(__amd64__) || defined(__x86_64__) || defined(__i386__) \
|| defined(__e2k__)
# define SPICE_ENDIAN SPICE_ENDIAN_LITTLE
# endif
# if defined(__BIG_ENDIAN__) || defined(__ARMEB__) \
|| defined(__THUMBEB__) || defined(__AARCH64EB__) \
|| defined(_MIPSEB) || defined(__MIPSEB) || defined(__MIPSEB__)
# ifdef SPICE_ENDIAN
# error Both little and big endian detected
# endif
# define SPICE_ENDIAN SPICE_ENDIAN_BIG
# endif
#endif
/* MS compiler */
#if !defined(SPICE_ENDIAN) && defined(_MSC_VER)
/* Windows support only little endian arm */
# if defined(_M_IX86) || defined(_M_AMD64) || defined(_M_X64) \
|| defined(_M_ARM) || defined(_M_ARM64)
# define SPICE_ENDIAN SPICE_ENDIAN_LITTLE
# endif
#endif
#if !defined(SPICE_ENDIAN)
#error Unable to detect processor endianness
#endif
#if SPICE_ENDIAN == SPICE_ENDIAN_PDP
#error PDP endianness not supported by Spice
#endif
#if SPICE_ENDIAN == SPICE_ENDIAN_LITTLE
#define SPICE_MAGIC_CONST(s) \
((uint32_t)((s[0]&0xffu)|((s[1]&0xffu)<<8)|((s[2]&0xffu)<<16)|((s[3]&0xffu)<<24)))
#else
#define SPICE_MAGIC_CONST(s) \
((uint32_t)((s[3]&0xffu)|((s[2]&0xffu)<<8)|((s[1]&0xffu)<<16)|((s[0]&0xffu)<<24)))
#endif
#endif /* _H_SPICE_MACROS */

18
spice/meson.build Normal file
View File

@ -0,0 +1,18 @@
spice_protocol_headers = [
'barrier.h',
'end-packed.h',
'enums.h',
'ipc_ring.h',
'macros.h',
'protocol.h',
'qxl_dev.h',
'qxl_windows.h',
'start-packed.h',
'stats.h',
'types.h',
'vd_agent.h',
'stream-device.h',
]
install_headers(spice_protocol_headers,
subdir : join_paths('spice-1', 'spice'))

View File

@ -33,17 +33,24 @@
#include <spice/types.h>
#include <spice/enums.h>
#include <spice/macros.h>
#include <spice/start-packed.h>
#define SPICE_MAGIC (*(uint32_t*)"REDQ")
#define SPICE_VERSION_MAJOR (~(uint32_t)0 - 1)
#define SPICE_VERSION_MINOR 0
#define SPICE_MAGIC SPICE_MAGIC_CONST("REDQ")
#define SPICE_VERSION_MAJOR 2
#define SPICE_VERSION_MINOR 2
// Encryption & Ticketing Parameters
#define SPICE_MAX_PASSWORD_LENGTH 60
#define SPICE_TICKET_KEY_PAIR_LENGTH 1024
#define SPICE_TICKET_PUBKEY_BYTES (SPICE_TICKET_KEY_PAIR_LENGTH / 8 + 34)
/*
* This is the maximum number of streams possible.
* IDs will be in the interval [0, SPICE_MAX_NUM_STREAMS).
*/
#define SPICE_MAX_NUM_STREAMS 64
typedef struct SPICE_ATTR_PACKED SpiceLinkHeader {
uint32_t magic;
uint32_t major_version;
@ -51,6 +58,13 @@ typedef struct SPICE_ATTR_PACKED SpiceLinkHeader {
uint32_t size;
} SpiceLinkHeader;
enum {
SPICE_COMMON_CAP_PROTOCOL_AUTH_SELECTION,
SPICE_COMMON_CAP_AUTH_SPICE,
SPICE_COMMON_CAP_AUTH_SASL,
SPICE_COMMON_CAP_MINI_HEADER,
};
typedef struct SPICE_ATTR_PACKED SpiceLinkMess {
uint32_t connection_id;
uint8_t channel_type;
@ -72,6 +86,10 @@ typedef struct SPICE_ATTR_PACKED SpiceLinkEncryptedTicket {
uint8_t encrypted_data[SPICE_TICKET_KEY_PAIR_LENGTH / 8];
} SpiceLinkEncryptedTicket;
typedef struct SPICE_ATTR_PACKED SpiceLinkAuthMechanism {
uint32_t auth_mechanism;
} SpiceLinkAuthMechanism;
typedef struct SPICE_ATTR_PACKED SpiceDataHeader {
uint64_t serial;
uint16_t type;
@ -79,6 +97,11 @@ typedef struct SPICE_ATTR_PACKED SpiceDataHeader {
uint32_t sub_list; //offset to SpiceSubMessageList[]
} SpiceDataHeader;
typedef struct SPICE_ATTR_PACKED SpiceMiniDataHeader {
uint16_t type;
uint32_t size;
} SpiceMiniDataHeader;
typedef struct SPICE_ATTR_PACKED SpiceSubMessage {
uint16_t type;
uint32_t size;
@ -93,10 +116,64 @@ typedef struct SPICE_ATTR_PACKED SpiceSubMessageList {
enum {
SPICE_PLAYBACK_CAP_CELT_0_5_1,
SPICE_PLAYBACK_CAP_VOLUME,
SPICE_PLAYBACK_CAP_LATENCY,
SPICE_PLAYBACK_CAP_OPUS,
};
enum {
SPICE_RECORD_CAP_CELT_0_5_1,
SPICE_RECORD_CAP_VOLUME,
SPICE_RECORD_CAP_OPUS,
};
enum {
SPICE_MAIN_CAP_SEMI_SEAMLESS_MIGRATE,
SPICE_MAIN_CAP_NAME_AND_UUID,
SPICE_MAIN_CAP_AGENT_CONNECTED_TOKENS,
SPICE_MAIN_CAP_SEAMLESS_MIGRATE,
};
enum {
SPICE_DISPLAY_CAP_SIZED_STREAM,
SPICE_DISPLAY_CAP_MONITORS_CONFIG,
SPICE_DISPLAY_CAP_COMPOSITE,
SPICE_DISPLAY_CAP_A8_SURFACE,
SPICE_DISPLAY_CAP_STREAM_REPORT,
SPICE_DISPLAY_CAP_LZ4_COMPRESSION,
SPICE_DISPLAY_CAP_PREF_COMPRESSION,
SPICE_DISPLAY_CAP_GL_SCANOUT,
SPICE_DISPLAY_CAP_MULTI_CODEC,
SPICE_DISPLAY_CAP_CODEC_MJPEG,
SPICE_DISPLAY_CAP_CODEC_VP8,
SPICE_DISPLAY_CAP_CODEC_H264,
SPICE_DISPLAY_CAP_PREF_VIDEO_CODEC_TYPE,
SPICE_DISPLAY_CAP_CODEC_VP9,
SPICE_DISPLAY_CAP_CODEC_H265,
SPICE_DISPLAY_CAP_GL_SCANOUT2,
SPICE_DISPLAY_CAP_CODEC_AV1,
SPICE_DISPLAY_CAP_CODEC_H264_444,
SPICE_DISPLAY_CAP_CODEC_VP9_444,
SPICE_DISPLAY_CAP_CODEC_H265_444,
SPICE_DISPLAY_CAP_CODEC_AV1_444,
SPICE_DISPLAY_CAP_CODEC_H264_U,
SPICE_DISPLAY_CAP_CODEC_VP9_U,
SPICE_DISPLAY_CAP_CODEC_H265_U,
SPICE_DISPLAY_CAP_CODEC_AV1_U,
};
enum {
SPICE_INPUTS_CAP_KEY_SCANCODE,
};
enum {
SPICE_SPICEVMC_CAP_DATA_COMPRESS_LZ4,
};
enum {
SPICE_PORT_EVENT_OPENED,
SPICE_PORT_EVENT_CLOSED,
SPICE_PORT_EVENT_BREAK,
};
#include <spice/end-packed.h>

View File

@ -36,6 +36,7 @@
#include <spice/barrier.h>
#include <spice/ipc_ring.h>
#include <spice/enums.h>
#include <spice/macros.h>
#include <spice/start-packed.h>
@ -43,14 +44,19 @@
/* 0x100-0x11f reserved for spice, 0x1ff used for unstable work */
#define QXL_DEVICE_ID_STABLE 0x0100
#define QXL_REVISION_STABLE_V04 0x01
#define QXL_REVISION_STABLE_V06 0x02
enum {
QXL_REVISION_STABLE_V04=0x01,
QXL_REVISION_STABLE_V06=0x02,
QXL_REVISION_STABLE_V10=0x03,
QXL_REVISION_STABLE_V12=0x04,
};
#define QXL_DEVICE_ID_DEVEL 0x01ff
#define QXL_REVISION_DEVEL 0x01
#define QXL_ROM_MAGIC (*(uint32_t*)"QXRO")
#define QXL_RAM_MAGIC (*(uint32_t*)"QXRA")
#define QXL_ROM_MAGIC SPICE_MAGIC_CONST("QXRO")
#define QXL_RAM_MAGIC SPICE_MAGIC_CONST("QXRA")
enum {
QXL_RAM_RANGE_INDEX,
@ -80,6 +86,17 @@ enum {
QXL_IO_DESTROY_PRIMARY,
QXL_IO_DESTROY_SURFACE_WAIT,
QXL_IO_DESTROY_ALL_SURFACES,
/* appended for qxl-3 */
QXL_IO_UPDATE_AREA_ASYNC,
QXL_IO_MEMSLOT_ADD_ASYNC,
QXL_IO_CREATE_PRIMARY_ASYNC,
QXL_IO_DESTROY_PRIMARY_ASYNC,
QXL_IO_DESTROY_SURFACE_ASYNC,
QXL_IO_DESTROY_ALL_SURFACES_ASYNC,
QXL_IO_FLUSH_SURFACES_ASYNC,
QXL_IO_FLUSH_RELEASE,
/* appended for qxl-4 */
QXL_IO_MONITORS_CONFIG_ASYNC,
QXL_IO_RANGE_SIZE
};
@ -109,6 +126,13 @@ typedef struct SPICE_ATTR_PACKED QXLRect {
int32_t right;
} QXLRect;
typedef struct SPICE_ATTR_PACKED QXLURect {
uint32_t top;
uint32_t left;
uint32_t bottom;
uint32_t right;
} QXLURect;
/* qxl-1 compat: append only */
typedef struct SPICE_ATTR_PACKED QXLRom {
uint32_t magic;
@ -132,9 +156,19 @@ typedef struct SPICE_ATTR_PACKED QXLRom {
uint8_t slot_gen_bits;
uint8_t slot_id_bits;
uint8_t slot_generation;
uint8_t padding[3]; /* Padding to 32bit align */
/* appended for qxl-4 */
uint8_t client_present;
uint8_t client_capabilities[58];
uint32_t client_monitors_config_crc;
struct {
uint16_t count;
uint16_t padding;
QXLURect heads[64];
} client_monitors_config;
} QXLRom;
#define CLIENT_MONITORS_CONFIG_CRC32_POLY 0xedb88320
/* qxl-1 compat: fixed */
typedef struct SPICE_ATTR_PACKED QXLMode {
uint32_t id;
@ -154,14 +188,14 @@ typedef struct SPICE_ATTR_PACKED QXLModes {
} QXLModes;
/* qxl-1 compat: append only */
enum QXLCmdType {
typedef enum QXLCmdType {
QXL_CMD_NOP,
QXL_CMD_DRAW,
QXL_CMD_UPDATE,
QXL_CMD_CURSOR,
QXL_CMD_MESSAGE,
QXL_CMD_SURFACE,
};
} QXLCmdType;
/* qxl-1 compat: fixed */
typedef struct SPICE_ATTR_PACKED QXLCommand {
@ -170,7 +204,8 @@ typedef struct SPICE_ATTR_PACKED QXLCommand {
uint32_t padding;
} QXLCommand;
#define QXL_COMMAND_FLAG_COMPAT (1<<0)
#define QXL_COMMAND_FLAG_COMPAT (1<<0)
#define QXL_COMMAND_FLAG_COMPAT_16BPP (2<<0)
typedef struct SPICE_ATTR_PACKED QXLCommandExt {
QXLCommand cmd;
@ -199,18 +234,26 @@ typedef struct SPICE_ATTR_PACKED QXLSurfaceCreate {
QXLPHYSICAL mem;
} QXLSurfaceCreate;
SPICE_RING_DECLARE(QXLCommandRing, QXLCommand, 32);
SPICE_RING_DECLARE(QXLCursorRing, QXLCommand, 32);
#define QXL_COMMAND_RING_SIZE 32
#define QXL_CURSOR_RING_SIZE 32
#define QXL_RELEASE_RING_SIZE 8
SPICE_RING_DECLARE(QXLReleaseRing, uint64_t, 8);
SPICE_RING_DECLARE(QXLCommandRing, QXLCommand, QXL_COMMAND_RING_SIZE);
SPICE_RING_DECLARE(QXLCursorRing, QXLCommand, QXL_CURSOR_RING_SIZE);
SPICE_RING_DECLARE(QXLReleaseRing, uint64_t, QXL_RELEASE_RING_SIZE);
#define QXL_LOG_BUF_SIZE 4096
#define QXL_INTERRUPT_DISPLAY (1 << 0)
#define QXL_INTERRUPT_CURSOR (1 << 1)
#define QXL_INTERRUPT_IO_CMD (1 << 2)
#define QXL_INTERRUPT_ERROR (1 << 3)
#define QXL_INTERRUPT_CLIENT (1 << 4)
#define QXL_INTERRUPT_CLIENT_MONITORS_CONFIG (1 << 5)
/* qxl-1 compat: append only */
typedef struct SPICE_ATTR_PACKED QXLRam {
typedef struct SPICE_ATTR_ALIGNED(4) SPICE_ATTR_PACKED QXLRam {
uint32_t magic;
uint32_t int_pending;
uint32_t int_mask;
@ -224,18 +267,19 @@ typedef struct SPICE_ATTR_PACKED QXLRam {
QXLMemSlot mem_slot;
QXLSurfaceCreate create_surface;
uint64_t flags;
/* appended for qxl-4 */
/* used by QXL_IO_MONITORS_CONFIG_ASYNC */
QXLPHYSICAL monitors_config;
} QXLRam;
typedef union QXLReleaseInfo {
typedef union SPICE_ATTR_PACKED QXLReleaseInfo {
uint64_t id; // in
uint64_t next; // out
} QXLReleaseInfo;
typedef struct QXLReleaseInfoExt {
QXLReleaseInfo *info;
uint32_t group_id;
} QXLReleaseInfoExt;
typedef struct SPICE_ATTR_PACKED QXLDataChunk {
uint32_t data_size;
QXLPHYSICAL prev_chunk;
@ -318,6 +362,7 @@ enum {
QXL_DRAW_TEXT,
QXL_DRAW_TRANSPARENT,
QXL_DRAW_ALPHA_BLEND,
QXL_DRAW_COMPOSITE
};
typedef struct SPICE_ATTR_PACKED QXLRasterGlyph {
@ -339,14 +384,17 @@ typedef struct SPICE_ATTR_PACKED QXLCopyBits {
QXLPoint src_pos;
} QXLCopyBits;
#define QXL_EFFECT_BLEND 0
#define QXL_EFFECT_OPAQUE 1
#define QXL_EFFECT_REVERT_ON_DUP 2
#define QXL_EFFECT_BLACKNESS_ON_DUP 3
#define QXL_EFFECT_WHITENESS_ON_DUP 4
#define QXL_EFFECT_NOP_ON_DUP 5
#define QXL_EFFECT_NOP 6
#define QXL_EFFECT_OPAQUE_BRUSH 7
typedef enum QXLEffectType
{
QXL_EFFECT_BLEND = 0,
QXL_EFFECT_OPAQUE = 1,
QXL_EFFECT_REVERT_ON_DUP = 2,
QXL_EFFECT_BLACKNESS_ON_DUP = 3,
QXL_EFFECT_WHITENESS_ON_DUP = 4,
QXL_EFFECT_NOP_ON_DUP = 5,
QXL_EFFECT_NOP = 6,
QXL_EFFECT_OPAQUE_BRUSH = 7
} QXLEffectType;
typedef struct SPICE_ATTR_PACKED QXLPattern {
QXLPHYSICAL pat;
@ -455,6 +503,79 @@ typedef struct SPICE_ATTR_PACKED QXLClip {
QXLPHYSICAL data;
} QXLClip;
typedef enum {
QXL_OP_CLEAR = 0x00,
QXL_OP_SOURCE = 0x01,
QXL_OP_DST = 0x02,
QXL_OP_OVER = 0x03,
QXL_OP_OVER_REVERSE = 0x04,
QXL_OP_IN = 0x05,
QXL_OP_IN_REVERSE = 0x06,
QXL_OP_OUT = 0x07,
QXL_OP_OUT_REVERSE = 0x08,
QXL_OP_ATOP = 0x09,
QXL_OP_ATOP_REVERSE = 0x0a,
QXL_OP_XOR = 0x0b,
QXL_OP_ADD = 0x0c,
QXL_OP_SATURATE = 0x0d,
/* Note the jump here from 0x0d to 0x30 */
QXL_OP_MULTIPLY = 0x30,
QXL_OP_SCREEN = 0x31,
QXL_OP_OVERLAY = 0x32,
QXL_OP_DARKEN = 0x33,
QXL_OP_LIGHTEN = 0x34,
QXL_OP_COLOR_DODGE = 0x35,
QXL_OP_COLOR_BURN = 0x36,
QXL_OP_HARD_LIGHT = 0x37,
QXL_OP_SOFT_LIGHT = 0x38,
QXL_OP_DIFFERENCE = 0x39,
QXL_OP_EXCLUSION = 0x3a,
QXL_OP_HSL_HUE = 0x3b,
QXL_OP_HSL_SATURATION = 0x3c,
QXL_OP_HSL_COLOR = 0x3d,
QXL_OP_HSL_LUMINOSITY = 0x3e
} QXLOperator;
typedef struct {
uint32_t t00;
uint32_t t01;
uint32_t t02;
uint32_t t10;
uint32_t t11;
uint32_t t12;
} QXLTransform;
/* The flags field has the following bit fields:
*
* operator: [ 0 - 7 ]
* src_filter: [ 8 - 10 ]
* mask_filter: [ 11 - 13 ]
* src_repeat: [ 14 - 15 ]
* mask_repeat: [ 16 - 17 ]
* component_alpha: [ 18 - 18 ]
* reserved: [ 19 - 31 ]
*
* The repeat and filter values are those of pixman:
* REPEAT_NONE = 0
* REPEAT_NORMAL = 1
* REPEAT_PAD = 2
* REPEAT_REFLECT = 3
*
* The filter values are:
* FILTER_NEAREST = 0
* FILTER_BILINEAR = 1
*/
typedef struct SPICE_ATTR_PACKED QXLComposite {
uint32_t flags;
QXLPHYSICAL src;
QXLPHYSICAL src_transform; /* May be NULL */
QXLPHYSICAL mask; /* May be NULL */
QXLPHYSICAL mask_transform; /* May be NULL */
QXLPoint16 src_origin;
QXLPoint16 mask_origin;
} QXLComposite;
typedef struct SPICE_ATTR_PACKED QXLCompatDrawable {
QXLReleaseInfo release_info;
uint8_t effect;
@ -507,13 +628,14 @@ typedef struct SPICE_ATTR_PACKED QXLDrawable {
QXLBlackness blackness;
QXLInvers invers;
QXLWhiteness whiteness;
QXLComposite composite;
} u;
} QXLDrawable;
enum QXLSurfaceCmdType {
typedef enum QXLSurfaceCmdType {
QXL_SURFACE_CMD_CREATE,
QXL_SURFACE_CMD_DESTROY,
};
} QXLSurfaceCmdType;
typedef struct SPICE_ATTR_PACKED QXLSurface {
uint32_t format;
@ -573,16 +695,16 @@ typedef union {
uint64_t value;
} QXLImageIDUnion;
enum {
typedef enum QXLImageFlags {
QXL_IMAGE_CACHE = (1 << 0),
QXL_IMAGE_HIGH_BITS_SET = (1 << 1),
};
} QXLImageFlags;
enum {
typedef enum QXLBitmapFlags {
QXL_BITMAP_DIRECT = (1 << 0),
QXL_BITMAP_UNSTABLE = (1 << 1),
QXL_BITMAP_TOP_DOWN = (1 << 2), // == SPICE_BITMAP_FLAGS_TOP_DOWN
};
} QXLBitmapFlags;
#define QXL_SET_IMAGE_ID(image, _group, _unique) { \
(image)->descriptor.id = (((uint64_t)_unique) << 32) | _group; \
@ -618,6 +740,9 @@ typedef struct SPICE_ATTR_PACKED QXLSurfaceId {
typedef struct SPICE_ATTR_PACKED QXLQUICData {
uint32_t data_size;
/* This data for QUIC is a QXLDataChunk.
* This differs from QXLBitmap where it's a reference to bitmap data or
* a reference to QXLDataChunk */
uint8_t data[0];
} QXLQUICData, QXLLZRGBData, QXLJPEGData;
@ -630,6 +755,31 @@ typedef struct SPICE_ATTR_PACKED QXLImage {
};
} QXLImage;
/* A QXLHead is a single monitor output backed by a QXLSurface.
* x and y offsets are unsigned since they are used in relation to
* the given surface, not the same as the x, y coordinates in the guest
* screen reference frame. */
typedef struct SPICE_ATTR_PACKED QXLHead {
uint32_t id;
uint32_t surface_id;
uint32_t width;
uint32_t height;
uint32_t x;
uint32_t y;
uint32_t flags;
} QXLHead;
typedef struct SPICE_ATTR_PACKED QXLMonitorsConfig {
uint16_t count;
uint16_t max_allowed; /* If it is 0 no fixed limit is given by the driver */
QXLHead heads[0];
} QXLMonitorsConfig;
#include <spice/end-packed.h>
typedef struct QXLReleaseInfoExt {
QXLReleaseInfo *info;
uint32_t group_id;
} QXLReleaseInfoExt;
#endif /* _H_QXL_DEV */

21
spice/qxl_windows.h Normal file
View File

@ -0,0 +1,21 @@
#ifndef _H_QXL_WINDOWS
#define _H_QXL_WINDOWS
#include <spice/types.h>
#include <spice/start-packed.h>
enum {
QXL_ESCAPE_SET_CUSTOM_DISPLAY = 0x10001,
QXL_ESCAPE_MONITOR_CONFIG
};
typedef struct SPICE_ATTR_PACKED QXLEscapeSetCustomDisplay {
uint32_t xres;
uint32_t yres;
uint32_t bpp;
} QXLEscapeSetCustomDisplay;
#include <spice/end-packed.h>
#endif /* _H_QXL_WINDOWS */

View File

@ -30,8 +30,8 @@
*/
/* Ideally this should all have been macros in a common headers, but
* its not possible to put pragmas into header files, so we have
* to use include magic.
* its not possible to put pragmas into macros, so we have to use
* include magic.
*
* Use it like this:
*
@ -48,12 +48,18 @@
#ifdef __GNUC__
#define SPICE_ATTR_PACKED __attribute__ ((__packed__))
#define SPICE_ATTR_ALIGNED(n) __attribute__ ((__aligned__ (n)))
#ifdef __MINGW32__
#pragma pack(push,1)
#endif
#else
#pragma pack(push)
#pragma pack(1)
#define SPICE_ATTR_PACKED
#define SPICE_ATTR_ALIGNED(n) __declspec (align (n))
#pragma warning(disable:4200)
#pragma warning(disable:4103)

View File

@ -31,11 +31,12 @@
#ifndef _H_SPICE_STATS
#define _H_SPICE_STATS
#include <spice/macros.h>
#include <spice/types.h>
#define SPICE_STAT_SHM_NAME "spice.%u"
#define SPICE_STAT_SHM_NAME "/spice.%u"
#define SPICE_STAT_NODE_NAME_MAX 20
#define SPICE_STAT_MAGIC (*(uint32_t*)"STAT")
#define SPICE_STAT_MAGIC SPICE_MAGIC_CONST("STAT")
#define SPICE_STAT_VERSION 1
enum {
@ -61,6 +62,8 @@ typedef struct SpiceStat {
uint32_t generation;
uint32_t num_of_nodes;
uint32_t root_index;
/* to avoid holes in the structure on some platforms */
uint32_t padding;
SpiceStatNode nodes[];
} SpiceStat;

270
spice/stream-device.h Normal file
View File

@ -0,0 +1,270 @@
/*
Copyright (C) 2017-2018 Red Hat, Inc.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
* This header contains definition for the device that
* allows to send streamed data to the server.
*
* The device is currently implemented as a VirtIO port inside the
* guest. The guest should open that device to use this protocol to
* communicate with the host.
*/
#ifndef SPICE_STREAM_DEVICE_H_
#define SPICE_STREAM_DEVICE_H_
#include <spice/types.h>
/*
* Structures are all "naturally aligned"
* containing integers up to 64 bit.
* All numbers are in little endian format.
*
* For security reasons structures should not contain implicit paddings.
*
* The protocol can be defined by these states:
* - Initial. Device just opened. Guest should wait
* for a message from the host;
* - Idle. No streaming allowed;
* - Ready. Server sent list of possible codecs;
* - Streaming. Stream active, enabled by the guest.
*/
/* version of the protocol */
#define STREAM_DEVICE_PROTOCOL 1
typedef struct StreamDevHeader {
/* should be STREAM_DEVICE_PROTOCOL */
uint8_t protocol_version;
/* reserved, should be set to 0 */
uint8_t padding;
/* as defined in StreamMsgType enumeration */
uint16_t type;
/* size of the following message.
* A message of type STREAM_TYPE_XXX_YYY is represented with a
* corresponding StreamMsgXxxYyy structure. */
uint32_t size;
} StreamDevHeader;
typedef enum StreamMsgType {
/* invalid, do not use */
STREAM_TYPE_INVALID = 0,
/* allows to send version information */
STREAM_TYPE_CAPABILITIES,
/* send screen resolution */
STREAM_TYPE_FORMAT,
/* stream data */
STREAM_TYPE_DATA,
/* server ask to start a new stream */
STREAM_TYPE_START_STOP,
/* server notify errors to guest */
STREAM_TYPE_NOTIFY_ERROR,
/* guest cursor */
STREAM_TYPE_CURSOR_SET,
/* guest cursor position */
STREAM_TYPE_CURSOR_MOVE,
/* the graphics device display information message (device address and display id) */
STREAM_TYPE_DEVICE_DISPLAY_INFO,
/* video encoding quality indicator message */
STREAM_TYPE_QUALITY_INDICATOR,
} StreamMsgType;
typedef enum StreamCapabilities {
/* handling of STREAM_TYPE_QUALITY_INDICATOR messages */
STREAM_CAP_QUALITY_INDICATOR,
STREAM_CAP_END // this must be the last
} StreamCapabilities;
/* Generic extension capabilities.
* This is a set of bits to specify which capabilities host and guest support.
* This message is sent by the host to the guest or by the guest to the host.
* Should be sent as first message.
* If it is not sent, it means that guest/host doesn't support any extension.
* Guest should send this as a reply from same type of message
* from the host.
* This message should be limited to STREAM_MSG_CAPABILITIES_MAX_BYTES. This
* allows plenty of negotiations.
*
* States allowed: Initial(host), Idle(guest)
* state will change to Idle.
*/
typedef struct StreamMsgCapabilities {
uint8_t capabilities[0];
} StreamMsgCapabilities;
#define STREAM_MSG_CAPABILITIES_MAX_BYTES 1024
/* Define the format of the stream, start a new stream.
* This message is sent by the guest to the host to
* tell the host the new stream format.
*
* States allowed: Ready
* state will change to Streaming.
*/
typedef struct StreamMsgFormat {
/* screen resolution/stream size */
uint32_t width;
uint32_t height;
/* as defined in SpiceVideoCodecType enumeration */
uint8_t codec;
uint8_t padding1[3];
} StreamMsgFormat;
/* This message contains just raw data stream.
* This message is sent by the guest to the host.
*
* States allowed: Streaming
*/
typedef struct StreamMsgData {
uint8_t data[0];
} StreamMsgData;
/* This message contains information about the graphics device and monitor
* belonging to a particular video stream (which maps to a channel) from
* the streaming agent.
*
* The device_address is the hardware address of the device (e.g. PCI),
* device_display_id is the id of the monitor on the device.
*
* The supported device address format is:
* "pci/<DOMAIN>/<SLOT>.<FUNCTION>/.../<SLOT>.<FUNCTION>"
*
* The "pci" identifies the rest of the string as a PCI address. It is the only
* supported address at the moment, other identifiers can be introduced later.
* <DOMAIN> is the PCI domain, followed by <SLOT>.<FUNCTION> of any PCI bridges
* in the chain leading to the device. The last <SLOT>.<FUNCTION> is the
* graphics device. All of <DOMAIN>, <SLOT>, <FUNCTION> are hexadecimal numbers
* with the following number of digits:
* <DOMAIN>: 4
* <SLOT>: 2
* <FUNCTION>: 1
*
* Sent from the streaming agent to the server.
*/
typedef struct StreamMsgDeviceDisplayInfo {
uint32_t stream_id;
uint32_t device_display_id;
uint32_t device_address_len;
uint8_t device_address[0]; // a zero-terminated string
} StreamMsgDeviceDisplayInfo;
/* This message contains a quality indicator string, generated by the
* streaming agent. It is intended to be used by a module running of
* the server to adjust the streaming quality.
*
* The format of the string message is not specified because
* module-specific.
*
* This message is sent by the guest to the host.
*
* States allowed: any
*
* Capability required: STREAM_CAP_QUALITY_INDICATOR
*/
typedef struct StreamMsgQualityIndicator {
uint8_t quality[0]; // a zero-terminated string
} StreamMsgQualityIndicator;
/* Tell to stop current stream and possibly start a new one.
* This message is sent by the host to the guest.
* Allows to communicate the codecs supported by the clients.
* The agent should stop the old stream and if any codec in the
* list is supported start streaming (as Mjpeg is always supported
* agent should stop only on a real stop request).
*
* States allowed: any
* state will change to Idle (no codecs) or Ready
*/
typedef struct StreamMsgStartStop {
/* supported codecs, 0 to stop streaming */
uint8_t num_codecs;
/* as defined in SpiceVideoCodecType enumeration */
uint8_t codecs[0];
} StreamMsgStartStop;
/* Tell guest about invalid protocol.
* This message is sent by the host to the guest.
* The server will stop processing data from the guest.
*
* States allowed: any
*/
typedef struct StreamMsgNotifyError {
/* numeric error code.
* Currently not defined, set to 0.
*/
uint32_t error_code;
/* String message, UTF-8 encoded.
* This field terminate with the message.
* Not necessary NUL-terminated.
*/
uint8_t msg[0];
} StreamMsgNotifyError;
#define STREAM_MSG_CURSOR_SET_MAX_WIDTH 1024
#define STREAM_MSG_CURSOR_SET_MAX_HEIGHT 1024
/* Guest cursor.
* This message is sent by the guest to the host.
*
* States allowed: Streaming
*/
typedef struct StreamMsgCursorSet {
/* basic cursor information */
/* for security reasons width and height should
* be limited to STREAM_MSG_CURSOR_SET_MAX_WIDTH and
* STREAM_MSG_CURSOR_SET_MAX_HEIGHT */
uint16_t width;
uint16_t height;
uint16_t hot_spot_x;
uint16_t hot_spot_y;
/* Cursor type, as defined by SpiceCursorType.
* Only ALPHA, COLOR24 and COLOR32 are allowed by this protocol
*/
uint8_t type;
uint8_t padding1[3];
/* cursor data.
* Format and size depends on cursor_header type and size
*/
uint8_t data[0];
} StreamMsgCursorSet;
/* Guest cursor position
* This message is sent by the guest to the host.
*
* States allowed: Streaming
*/
typedef struct StreamMsgCursorMove {
int32_t x;
int32_t y;
} StreamMsgCursorMove;
#endif /* SPICE_STREAM_DEVICE_H_ */

View File

@ -35,23 +35,167 @@
#include <spice/start-packed.h>
enum {
VDP_CLIENT_PORT = 1,
VDP_SERVER_PORT,
VDP_END_PORT
};
typedef struct SPICE_ATTR_PACKED VDIChunkHeader {
uint32_t port;
uint32_t size;
} VDIChunkHeader;
typedef struct SPICE_ATTR_PACKED VDAgentMessage {
/* Should be VD_AGENT_PROTOCOL */
uint32_t protocol;
/* One of VD_AGENT_xxx in the enumeration below */
uint32_t type;
uint64_t opaque;
/* Size of data following */
uint32_t size;
uint8_t data[0];
} VDAgentMessage;
#define VD_AGENT_PROTOCOL 1
#define VD_AGENT_MAX_DATA_SIZE 2048
/*
* Messages and types for guest agent.
* These messages are sent through the virtio port "com.redhat.spice.0"
* (agent <-> server) or embedded in "agent_data" SPICE protocol message in
* the "MainChannel" (server <-> client)
*/
enum {
/* server -> agent
* See VDAgentMouseState structure.
*/
VD_AGENT_MOUSE_STATE = 1,
/* client -> agent|server.
* Acknowledged by the agent using VD_AGENT_REPLY.
* See VDAgentMonitorsConfig structure.
*/
VD_AGENT_MONITORS_CONFIG,
/* agent -> client.
* See VDAgentReply structure.
*/
VD_AGENT_REPLY,
/* Set clipboard data (both directions).
* Message comes with type and data.
* See VDAgentClipboard structure.
*/
VD_AGENT_CLIPBOARD,
/* client -> agent.
* Acknowledged by Windows agent using VD_AGENT_REPLY.
* See VDAgentDisplayConfig structure.
*/
VD_AGENT_DISPLAY_CONFIG,
/* See VDAgentAnnounceCapabilities structure. */
VD_AGENT_ANNOUNCE_CAPABILITIES,
/* Asks to listen for clipboard changes (both directions).
* Remote should empty clipboard and wait for one
* of the types passed.
* See VDAgentClipboardGrab structure.
*/
VD_AGENT_CLIPBOARD_GRAB,
/* Asks for clipboard data (both directions).
* Request comes with a specific type.
* See VDAgentClipboardRequest structure.
*/
VD_AGENT_CLIPBOARD_REQUEST,
/* See VDAgentClipboardRelease structure. */
VD_AGENT_CLIPBOARD_RELEASE,
/* See VDAgentFileXferStartMessage structure. */
VD_AGENT_FILE_XFER_START,
/* See VDAgentFileXferStatusMessage structure. */
VD_AGENT_FILE_XFER_STATUS,
/* See VDAgentFileXferDataMessage structure. */
VD_AGENT_FILE_XFER_DATA,
/* Empty message */
VD_AGENT_CLIENT_DISCONNECTED,
/* See VDAgentMaxClipboard structure. */
VD_AGENT_MAX_CLIPBOARD,
/* See VDAgentAudioVolumeSync structure. */
VD_AGENT_AUDIO_VOLUME_SYNC,
/* See VDAgentGraphicsDeviceInfo structure. */
VD_AGENT_GRAPHICS_DEVICE_INFO,
VD_AGENT_END_MESSAGE,
};
enum {
VD_AGENT_FILE_XFER_STATUS_CAN_SEND_DATA,
VD_AGENT_FILE_XFER_STATUS_CANCELLED,
VD_AGENT_FILE_XFER_STATUS_ERROR,
VD_AGENT_FILE_XFER_STATUS_SUCCESS,
VD_AGENT_FILE_XFER_STATUS_NOT_ENOUGH_SPACE,
VD_AGENT_FILE_XFER_STATUS_SESSION_LOCKED,
VD_AGENT_FILE_XFER_STATUS_VDAGENT_NOT_CONNECTED,
VD_AGENT_FILE_XFER_STATUS_DISABLED,
};
typedef struct SPICE_ATTR_PACKED VDAgentFileXferStatusMessage {
uint32_t id;
uint32_t result;
/* Used to send additional data for detailed error messages
* to clients with VD_AGENT_CAP_FILE_XFER_DETAILED_ERRORS capability.
* Type of data varies with the result:
* result : data type (NULL if no data)
* VD_AGENT_FILE_XFER_STATUS_ERROR : VDAgentFileXferStatusError
* VD_AGENT_FILE_XFER_STATUS_NOT_ENOUGH_SPACE : VDAgentFileXferStatusNotEnoughSpace
* VD_AGENT_FILE_XFER_STATUS_SESSION_LOCKED : NULL
* VD_AGENT_FILE_XFER_STATUS_VDAGENT_NOT_CONNECTED : NULL
* VD_AGENT_FILE_XFER_STATUS_DISABLED : NULL
*/
uint8_t data[0];
} VDAgentFileXferStatusMessage;
/* Detailed error for VD_AGENT_FILE_XFER_STATUS_NOT_ENOUGH_SPACE.
* Only present if VD_AGENT_CAP_FILE_XFER_DETAILED_ERRORS is
* negotiated and the size of the message can contain it.
*/
typedef struct SPICE_ATTR_PACKED VDAgentFileXferStatusNotEnoughSpace {
/* Disk free space in bytes. */
uint64_t disk_free_space;
} VDAgentFileXferStatusNotEnoughSpace;
enum {
/* Error number is a G_IO_ERROR_xxx defined in
* https://developer.gnome.org/gio/stable/gio-GIOError.html
*/
VD_AGENT_FILE_XFER_STATUS_ERROR_GLIB_IO,
};
/* Detailed error for VD_AGENT_FILE_XFER_STATUS_ERROR.
* Only present if VD_AGENT_CAP_FILE_XFER_DETAILED_ERRORS is
* negotiated and the size of the message can contain it.
* Otherwise a generic error should be assumed and reported.
*/
typedef struct SPICE_ATTR_PACKED VDAgentFileXferStatusError {
/* One of VD_AGENT_FILE_XFER_STATUS_ERROR_xxx enumeration
*/
uint8_t error_type;
/* An error code which enumeration depends on error_type
*/
uint32_t error_code;
} VDAgentFileXferStatusError;
typedef struct SPICE_ATTR_PACKED VDAgentFileXferStartMessage {
uint32_t id;
uint8_t data[0];
} VDAgentFileXferStartMessage;
typedef struct SPICE_ATTR_PACKED VDAgentFileXferDataMessage {
uint32_t id;
uint64_t size;
uint8_t data[0];
} VDAgentFileXferDataMessage;
typedef struct SPICE_ATTR_PACKED VDAgentMonConfig {
/*
* Note a width and height of 0 can be used to indicate a disabled
* monitor, this may only be used with agents with the
* VD_AGENT_CAP_SPARSE_MONITORS_CONFIG capability.
*/
uint32_t height;
uint32_t width;
uint32_t depth;
@ -61,19 +205,49 @@ 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),
VD_AGENT_DISPLAY_CONFIG_FLAG_DISABLE_ANIMATION = (1 << 2),
VD_AGENT_DISPLAY_CONFIG_FLAG_SET_COLOR_DEPTH = (1 << 3),
};
typedef struct SPICE_ATTR_PACKED VDAgentDisplayConfig {
uint32_t flags;
uint32_t depth;
} VDAgentDisplayConfig;
#define VD_AGENT_LBUTTON_MASK (1 << 1)
#define VD_AGENT_MBUTTON_MASK (1 << 2)
#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;
@ -92,6 +266,145 @@ enum {
VD_AGENT_ERROR,
};
typedef struct SPICE_ATTR_PACKED VDAgentClipboard {
#if 0 /* VD_AGENT_CAP_CLIPBOARD_SELECTION */
uint8_t selection;
uint8_t __reserved[sizeof(uint32_t) - 1 * sizeof(uint8_t)];
#endif
uint32_t type;
uint8_t data[0];
} VDAgentClipboard;
enum {
VD_AGENT_CLIPBOARD_NONE = 0,
VD_AGENT_CLIPBOARD_UTF8_TEXT,
VD_AGENT_CLIPBOARD_IMAGE_PNG, /* All clients with image support should support this one */
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 {
VD_AGENT_CLIPBOARD_SELECTION_CLIPBOARD = 0,
VD_AGENT_CLIPBOARD_SELECTION_PRIMARY,
VD_AGENT_CLIPBOARD_SELECTION_SECONDARY,
};
typedef struct SPICE_ATTR_PACKED VDAgentClipboardGrab {
#if 0 /* VD_AGENT_CAP_CLIPBOARD_SELECTION */
uint8_t selection;
uint8_t __reserved[sizeof(uint32_t) - 1 * sizeof(uint8_t)];
#endif
#if 0 /* VD_AGENT_CAP_CLIPBOARD_GRAB_SERIAL */
uint32_t serial;
#endif
uint32_t types[0];
} VDAgentClipboardGrab;
typedef struct SPICE_ATTR_PACKED VDAgentClipboardRequest {
#if 0 /* VD_AGENT_CAP_CLIPBOARD_SELECTION */
uint8_t selection;
uint8_t __reserved[sizeof(uint32_t) - 1 * sizeof(uint8_t)];
#endif
uint32_t type;
} VDAgentClipboardRequest;
typedef struct SPICE_ATTR_PACKED VDAgentClipboardRelease {
#if 0 /* VD_AGENT_CAP_CLIPBOARD_SELECTION */
uint8_t selection;
uint8_t __reserved[sizeof(uint32_t) - 1 * sizeof(uint8_t)];
#endif
uint8_t dummy_empty_field[0]; /* C/C++ compatibility */
} VDAgentClipboardRelease;
typedef struct SPICE_ATTR_PACKED VDAgentMaxClipboard {
int32_t max;
} VDAgentMaxClipboard;
typedef struct SPICE_ATTR_PACKED VDAgentAudioVolumeSync {
uint8_t is_playback;
uint8_t mute;
uint8_t nchannels;
uint16_t volume[0];
} VDAgentAudioVolumeSync;
typedef struct SPICE_ATTR_PACKED VDAgentDeviceDisplayInfo {
uint32_t channel_id;
uint32_t monitor_id;
uint32_t device_display_id;
uint32_t device_address_len;
uint8_t device_address[0]; /* a zero-terminated string */
} VDAgentDeviceDisplayInfo;
/* This message contains the mapping of (channel_id, monitor_id) pair to a
* "physical" (virtualized) device and its monitor identified by device_address
* and device_display_id.
*
* It's used on the vd_agent to identify the guest monitors for the
* mouse_position and monitors_config messages.
*/
typedef struct SPICE_ATTR_PACKED VDAgentGraphicsDeviceInfo {
uint32_t count;
#ifdef _MSC_VER
uint8_t display_info[0];
#else
VDAgentDeviceDisplayInfo display_info[0];
#endif
} VDAgentGraphicsDeviceInfo;
/* Capabilities definitions
*/
enum {
VD_AGENT_CAP_MOUSE_STATE = 0,
VD_AGENT_CAP_MONITORS_CONFIG,
VD_AGENT_CAP_REPLY,
VD_AGENT_CAP_CLIPBOARD,
VD_AGENT_CAP_DISPLAY_CONFIG,
VD_AGENT_CAP_CLIPBOARD_BY_DEMAND,
VD_AGENT_CAP_CLIPBOARD_SELECTION,
VD_AGENT_CAP_SPARSE_MONITORS_CONFIG,
VD_AGENT_CAP_GUEST_LINEEND_LF,
VD_AGENT_CAP_GUEST_LINEEND_CRLF,
VD_AGENT_CAP_MAX_CLIPBOARD,
VD_AGENT_CAP_AUDIO_VOLUME_SYNC,
VD_AGENT_CAP_MONITORS_CONFIG_POSITION,
VD_AGENT_CAP_FILE_XFER_DISABLED,
VD_AGENT_CAP_FILE_XFER_DETAILED_ERRORS,
VD_AGENT_CAP_GRAPHICS_DEVICE_INFO,
VD_AGENT_CAP_CLIPBOARD_NO_RELEASE_ON_REGRAB,
VD_AGENT_CAP_CLIPBOARD_GRAB_SERIAL,
VD_AGENT_END_CAP,
};
typedef struct SPICE_ATTR_PACKED VDAgentAnnounceCapabilities {
uint32_t request;
uint32_t caps[0];
} VDAgentAnnounceCapabilities;
#define VD_AGENT_CAPS_SIZE_FROM_MSG_SIZE(msg_size) \
(((msg_size) - sizeof(VDAgentAnnounceCapabilities)) / sizeof(uint32_t))
#define VD_AGENT_CAPS_SIZE ((VD_AGENT_END_CAP + 31) / 32)
#define VD_AGENT_CAPS_BYTES (((VD_AGENT_END_CAP + 31) / 8) & ~3)
#define VD_AGENT_HAS_CAPABILITY(caps, caps_size, index) \
((index) < (caps_size * 32) && ((caps)[(index) / 32] & (1 << ((index) % 32))))
#define VD_AGENT_SET_CAPABILITY(caps, index) \
{ (caps)[(index) / 32] |= (1 << ((index) % 32)); }
#define VD_AGENT_CLEAR_CAPABILITY(caps, index) \
{ (caps)[(index) / 32] &= ~(1 << ((index) % 32)); }
#include <spice/end-packed.h>
#endif /* _H_VD_AGENT */

View File

@ -1,82 +0,0 @@
/*
Copyright (C) 2009 Red Hat, Inc.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _H_VDI_DEV
#define _H_VDI_DEV
#include <spice/types.h>
#include <spice/barrier.h>
#include <spice/ipc_ring.h>
#include <spice/start-packed.h>
#define REDHAT_PCI_VENDOR_ID 0x1b36
#define VDI_PORT_DEVICE_ID 0x0105
#define VDI_PORT_REVISION 0x01
#define VDI_PORT_INTERRUPT (1 << 0)
#define VDI_PORT_MAGIC (*(uint32_t*)"VDIP")
typedef struct SPICE_ATTR_PACKED VDIPortPacket {
uint32_t gen;
uint32_t size;
uint8_t data[512 - 2 * sizeof(uint32_t)];
} VDIPortPacket;
SPICE_RING_DECLARE(VDIPortRing, VDIPortPacket, 32);
enum {
VDI_PORT_IO_RANGE_INDEX,
VDI_PORT_RAM_RANGE_INDEX,
};
enum {
VDI_PORT_IO_CONNECTION,
VDI_PORT_IO_NOTIFY = 4,
VDI_PORT_IO_UPDATE_IRQ = 8,
VDI_PORT_IO_RANGE_SIZE = 12
};
typedef struct SPICE_ATTR_PACKED VDIPortRam {
uint32_t magic;
uint32_t generation;
uint32_t int_pending;
uint32_t int_mask;
VDIPortRing input;
VDIPortRing output;
uint32_t reserv[32];
} VDIPortRam;
#include <spice/end-packed.h>
#endif /* _H_VDI_DEV */