summaryrefslogtreecommitdiffstats
path: root/server/char_device.h
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2011-08-25 12:16:06 +0200
committerHans de Goede <hdegoede@redhat.com>2011-08-25 14:04:27 +0200
commitc030382abbd14c3ae09db030719e52efa8600f15 (patch)
treee870a2c9670121f632e5725fc0f7d5382423124e /server/char_device.h
parent073cf20ac57b9e035f247f180a109f29333dacb8 (diff)
downloadspice-c030382abbd14c3ae09db030719e52efa8600f15.tar.gz
spice-c030382abbd14c3ae09db030719e52efa8600f15.tar.xz
spice-c030382abbd14c3ae09db030719e52efa8600f15.zip
Rename usbredir channel code to spicevmc
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 usbredir.c to spicevmc.c and changes the prefix of all functions / structs to match. This should make clear that the code is not usbredir specific. 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, they must start at the SPICE_CHANNEL_USER_DEFINED_START value (128). 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>
Diffstat (limited to 'server/char_device.h')
-rw-r--r--server/char_device.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/char_device.h b/server/char_device.h
index 4b558698..bdb32ae9 100644
--- a/server/char_device.h
+++ b/server/char_device.h
@@ -7,8 +7,8 @@ struct SpiceCharDeviceState {
void (*wakeup)(SpiceCharDeviceInstance *sin);
};
-int usbredir_device_connect(SpiceCharDeviceInstance *char_device);
-void usbredir_device_disconnect(SpiceCharDeviceInstance *char_device);
+void spicevmc_device_connect(SpiceCharDeviceInstance *sin,
+ uint8_t channel_type);
+void spicevmc_device_disconnect(SpiceCharDeviceInstance *char_device);
#endif // __CHAR_DEVICE_H__
-