Commit Graph

188 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
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
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