diff mbox series

[v2,05/12] spice: merge options lists

Message ID 20181220141553.24098-6-marcandre.lureau@redhat.com
State New
Headers show
Series spice: add -display spice-app, setup and launch a Spice client | expand

Commit Message

Marc-André Lureau Dec. 20, 2018, 2:15 p.m. UTC
Passing several -spice options to qemu command line, or calling
several time qemu_opts_set() will ignore all but the first option
list. Since the spice server is a singleton, it makes sense to merge
all the options, the last value being the one taken into account.

This changes the behaviour from, for ex:
$ qemu... -spice port=5900 -spice port=5901 -> port: 5900
to:
$ qemu... -spice port=5900 -spice port=5901 -> port: 5901

(if necessary we could instead produce an error when an option is
given twice, although this makes handling default values and such more
complicated)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
---
 ui/spice-core.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/ui/spice-core.c b/ui/spice-core.c
index 1f1501de78..6fefd95cea 100644
--- a/ui/spice-core.c
+++ b/ui/spice-core.c
@@ -398,6 +398,7 @@  static SpiceChannelList *qmp_query_spice_channels(void)
 static QemuOptsList qemu_spice_opts = {
     .name = "spice",
     .head = QTAILQ_HEAD_INITIALIZER(qemu_spice_opts.head),
+    .merge_lists = true,
     .desc = {
         {
             .name = "port",