diff mbox series

[PULL,08/15] spice: merge options lists

Message ID 20190222075326.9850-9-kraxel@redhat.com
State New
Headers show
Series [PULL,01/15] kbd-state: don't block auto-repeat events | expand

Commit Message

Gerd Hoffmann Feb. 22, 2019, 7:53 a.m. UTC
From: Marc-André Lureau <marcandre.lureau@redhat.com>

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>
Tested-by: Victor Toso <victortoso@redhat.com>
Message-id: 20190221110703.5775-5-marcandre.lureau@redhat.com
Signed-off-by: Gerd Hoffmann <kraxel@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 784fddff7d45..1cc996027719 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",