diff options
author | Gerd Hoffmann <kraxel@redhat.com> | 2010-08-27 14:29:16 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2010-10-08 12:49:51 +0200 |
commit | 333b0eebcc8941b8453e837293eaa1191e967c25 (patch) | |
tree | 3944a985f58375d58c06a88466419ea2c17fb125 /ui/spice-core.c | |
parent | 17b6dea08bd8c8484bc48dc67add236d2fe002b5 (diff) | |
download | qemu-333b0eebcc8941b8453e837293eaa1191e967c25.zip |
spice: add config options for the listening address
Make listening address configurable. Also add options to
force using IPv4 or IPv6.
Diffstat (limited to 'ui/spice-core.c')
-rw-r--r-- | ui/spice-core.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/ui/spice-core.c b/ui/spice-core.c index 7664ef7700..6f613c6324 100644 --- a/ui/spice-core.c +++ b/ui/spice-core.c @@ -221,14 +221,14 @@ static int add_channel(const char *name, const char *value, void *opaque) void qemu_spice_init(void) { QemuOpts *opts = QTAILQ_FIRST(&qemu_spice_opts.head); - const char *password, *str, *x509_dir, + const char *password, *str, *x509_dir, *addr, *x509_key_password = NULL, *x509_dh_file = NULL, *tls_ciphers = NULL; char *x509_key_file = NULL, *x509_cert_file = NULL, *x509_cacert_file = NULL; - int port, tls_port, len; + int port, tls_port, len, addr_flags; spice_image_compression_t compression; spice_wan_compression_t wan_compr; @@ -278,7 +278,16 @@ void qemu_spice_init(void) tls_ciphers = qemu_opt_get(opts, "tls-ciphers"); } + addr = qemu_opt_get(opts, "addr"); + addr_flags = 0; + if (qemu_opt_get_bool(opts, "ipv4", 0)) { + addr_flags |= SPICE_ADDR_FLAG_IPV4_ONLY; + } else if (qemu_opt_get_bool(opts, "ipv6", 0)) { + addr_flags |= SPICE_ADDR_FLAG_IPV6_ONLY; + } + spice_server = spice_server_new(); + spice_server_set_addr(spice_server, addr ? addr : "", addr_flags); if (port) { spice_server_set_port(spice_server, port); } |