diff options
author | Daniel P. Berrange <berrange@redhat.com> | 2012-02-13 13:43:08 +0000 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2012-02-21 10:36:05 +0100 |
commit | f1f5f4070ce2fc95f23e14d4f1e33ea75732af55 (patch) | |
tree | dd1197b0ffce3d5b2a175165335958ada0cd017b /ui | |
parent | 2aa9e85c4634100cd10b1a052b0d6e22e1ce5911 (diff) | |
download | qemu-f1f5f4070ce2fc95f23e14d4f1e33ea75732af55.zip qemu-f1f5f4070ce2fc95f23e14d4f1e33ea75732af55.tar.gz qemu-f1f5f4070ce2fc95f23e14d4f1e33ea75732af55.tar.bz2 |
Add SPICE support to add_client monitor command
With the acceptance of some new APIs to libspice-server.so it
is possible to add support for SPICE to the 'add_client'
monitor command, bringing parity with VNC. Since SPICE can
use TLS or plain connections, the command also gains a new
'tls' parameter to specify whether TLS should be attempted
on the injected client sockets.
This new feature is only enabled if building against a
libspice-server >= 0.10.1
* qmp-commands.hx: Add 'tls' parameter & missing doc for
'skipauth' parameter
* monitor.c: Wire up SPICE for 'add_client' command
* ui/qemu-spice.h, ui/spice-core.c: Add qemu_spice_display_add_client
API to wire up from monitor
[1] http://cgit.freedesktop.org/spice/spice/commit/server/spice.h?id=d55b68b6b44f2499278fa860fb47ff22f5011faa
http://cgit.freedesktop.org/spice/spice/commit/server/spice.h?id=bd07dde530d9504e1cfe7ed5837fc00c26f36716
Changes in v3:
- Added 'optional' flag to new parameters documented
- Added no-op impl of qemu_spice_display_add_client when
SPICE is disabled during build
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui')
-rw-r--r-- | ui/qemu-spice.h | 7 | ||||
-rw-r--r-- | ui/spice-core.c | 13 |
2 files changed, 20 insertions, 0 deletions
diff --git a/ui/qemu-spice.h b/ui/qemu-spice.h index c35b29c..680206a 100644 --- a/ui/qemu-spice.h +++ b/ui/qemu-spice.h @@ -33,6 +33,7 @@ void qemu_spice_init(void); void qemu_spice_input_init(void); void qemu_spice_audio_init(void); void qemu_spice_display_init(DisplayState *ds); +int qemu_spice_display_add_client(int csock, int skipauth, int tls); int qemu_spice_add_interface(SpiceBaseInstance *sin); int qemu_spice_set_passwd(const char *passwd, bool fail_if_connected, bool disconnect_if_connected); @@ -68,6 +69,12 @@ static inline int qemu_spice_migrate_info(const char *h, int p, int t, return -1; } +static inline int qemu_spice_display_add_client(int csock, int skipauth, + int tls) +{ + return -1; +} + #endif /* CONFIG_SPICE */ #endif /* QEMU_SPICE_H */ diff --git a/ui/spice-core.c b/ui/spice-core.c index b4629f8..05cb745 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -747,6 +747,19 @@ int qemu_spice_set_pw_expire(time_t expires) return qemu_spice_set_ticket(false, false); } +int qemu_spice_display_add_client(int csock, int skipauth, int tls) +{ +#if SPICE_SERVER_VERSION >= 0x000a01 + if (tls) { + return spice_server_add_ssl_client(spice_server, csock, skipauth); + } else { + return spice_server_add_client(spice_server, csock, skipauth); + } +#else + return -1; +#endif +} + static void spice_register_config(void) { qemu_add_opts(&qemu_spice_opts); |