spice-protocol/spice
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
..
barrier.h define spice_mb MemoryBarrier for WIN64 2011-02-02 11:34:19 +02:00
controller_prot.h protocol: use packed-start/end to pack structures 2011-04-11 13:01:57 +02:00
end-packed.h mingw32: specify packing alignment to 1 byte, to override -mms-bitfield 2010-12-29 16:13:55 +01:00
enums.h Change usbredir messages to spicevmc messages 2011-08-25 11:12:34 +02:00
error_codes.h Clean up and standardize header guards 2010-02-04 16:47:14 +01:00
foreign_menu_prot.h protocol: use packed-start/end to pack structures 2011-04-11 13:01:57 +02:00
ipc_ring.h Fix up SPICE_SPICE typo 2010-02-04 18:10:50 +01:00
macros.h macros: define INLINE 2011-05-12 11:45:58 +03:00
Makefile.am Add controller protocol 2010-10-18 10:08:45 +02:00
protocol.h protocol: add SPICE_{PLAYBACK,RECORD}_CAP_VOLUME caps 2011-06-22 12:01:10 +02:00
qxl_dev.h qxl_dev: add third revision V10 2011-07-17 13:19:48 +03:00
start-packed.h mingw32: specify packing alignment to 1 byte, to override -mms-bitfield 2010-12-29 16:13:55 +01:00
stats.h Clean up and standardize header guards 2010-02-04 16:47:14 +01:00
types.h Add byteswapping macros 2010-05-19 16:02:40 +02:00
vd_agent.h vd_agent.h: Add a VDP_END_PORT to the chunk port enum 2011-03-24 11:28:51 +01:00
vdi_dev.h Always include using <spice/foo.h> style 2010-02-04 16:47:23 +01:00