Revision 333b0eeb
b/qemu-config.c | ||
---|---|---|
365 | 365 |
.name = "tls-port", |
366 | 366 |
.type = QEMU_OPT_NUMBER, |
367 | 367 |
},{ |
368 |
.name = "addr", |
|
369 |
.type = QEMU_OPT_STRING, |
|
370 |
},{ |
|
371 |
.name = "ipv4", |
|
372 |
.type = QEMU_OPT_BOOL, |
|
373 |
},{ |
|
374 |
.name = "ipv6", |
|
375 |
.type = QEMU_OPT_BOOL, |
|
376 |
},{ |
|
368 | 377 |
.name = "password", |
369 | 378 |
.type = QEMU_OPT_STRING, |
370 | 379 |
},{ |
b/qemu-options.hx | ||
---|---|---|
682 | 682 |
@item port=<nr> |
683 | 683 |
Set the TCP port spice is listening on for plaintext channels. |
684 | 684 |
|
685 |
@item addr=<addr> |
|
686 |
Set the IP address spice is listening on. Default is any address. |
|
687 |
|
|
688 |
@item ipv4 |
|
689 |
@item ipv6 |
|
690 |
Force using the specified IP version. |
|
691 |
|
|
685 | 692 |
@item password=<secret> |
686 | 693 |
Set the password you need to authenticate. |
687 | 694 |
|
b/ui/spice-core.c | ||
---|---|---|
221 | 221 |
void qemu_spice_init(void) |
222 | 222 |
{ |
223 | 223 |
QemuOpts *opts = QTAILQ_FIRST(&qemu_spice_opts.head); |
224 |
const char *password, *str, *x509_dir, |
|
224 |
const char *password, *str, *x509_dir, *addr,
|
|
225 | 225 |
*x509_key_password = NULL, |
226 | 226 |
*x509_dh_file = NULL, |
227 | 227 |
*tls_ciphers = NULL; |
228 | 228 |
char *x509_key_file = NULL, |
229 | 229 |
*x509_cert_file = NULL, |
230 | 230 |
*x509_cacert_file = NULL; |
231 |
int port, tls_port, len; |
|
231 |
int port, tls_port, len, addr_flags;
|
|
232 | 232 |
spice_image_compression_t compression; |
233 | 233 |
spice_wan_compression_t wan_compr; |
234 | 234 |
|
... | ... | |
278 | 278 |
tls_ciphers = qemu_opt_get(opts, "tls-ciphers"); |
279 | 279 |
} |
280 | 280 |
|
281 |
addr = qemu_opt_get(opts, "addr"); |
|
282 |
addr_flags = 0; |
|
283 |
if (qemu_opt_get_bool(opts, "ipv4", 0)) { |
|
284 |
addr_flags |= SPICE_ADDR_FLAG_IPV4_ONLY; |
|
285 |
} else if (qemu_opt_get_bool(opts, "ipv6", 0)) { |
|
286 |
addr_flags |= SPICE_ADDR_FLAG_IPV6_ONLY; |
|
287 |
} |
|
288 |
|
|
281 | 289 |
spice_server = spice_server_new(); |
290 |
spice_server_set_addr(spice_server, addr ? addr : "", addr_flags); |
|
282 | 291 |
if (port) { |
283 | 292 |
spice_server_set_port(spice_server, port); |
284 | 293 |
} |
Also available in: Unified diff