diff options
author | Hans de Goede <hdegoede@redhat.com> | 2011-03-27 16:43:54 +0200 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2011-05-04 13:33:08 +0200 |
commit | 42916b85f308e890bd7737aab7080fbba9eccce9 (patch) | |
tree | 4197f6577d38774ef201d4423ddc336b3bc47bf4 | |
parent | 6bfdb5cc6cfb7820a5b91cc55a634e345d286d7a (diff) |
spice: add option for disabling copy paste support
Some people want to be able disable spice's guest <-> client copy paste support
because of security considerations.
-rw-r--r-- | qemu-config.c | 3 | ||||
-rw-r--r-- | qemu-options.hx | 3 | ||||
-rw-r--r-- | ui/spice-core.c | 9 |
3 files changed, 15 insertions, 0 deletions
diff --git a/qemu-config.c b/qemu-config.c index 6d9c23881..b2d682360 100644 --- a/qemu-config.c +++ b/qemu-config.c @@ -390,6 +390,9 @@ QemuOptsList qemu_spice_opts = { .name = "disable-ticketing", .type = QEMU_OPT_BOOL, },{ + .name = "disable-copy-paste", + .type = QEMU_OPT_BOOL, + },{ .name = "x509-dir", .type = QEMU_OPT_STRING, },{ diff --git a/qemu-options.hx b/qemu-options.hx index 328a1f9df..4fbfe1f2d 100644 --- a/qemu-options.hx +++ b/qemu-options.hx @@ -698,6 +698,9 @@ Set the password you need to authenticate. @item disable-ticketing Allow client connects without authentication. +@item disable-copy-paste +Disable copy paste between the client and the guest. + @item tls-port=<nr> Set the TCP port spice is listening on for encrypted channels. diff --git a/ui/spice-core.c b/ui/spice-core.c index 1aa1a5ed1..7d2b9f060 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -554,6 +554,15 @@ void qemu_spice_init(void) spice_server_set_noauth(spice_server); } + if (qemu_opt_get_bool(opts, "disable-copy-paste", 0)) { +#if SPICE_SERVER_VERSION >= 0x000801 + spice_server_set_agent_copypaste(spice_server, 0); +#else + fprintf(stderr, "spice: disable-copy-paste is only supported when compiled with spice-server >= 0.8.1\n"); + exit(1); +#endif + } + compression = SPICE_IMAGE_COMPRESS_AUTO_GLZ; str = qemu_opt_get(opts, "image-compression"); if (str) { |