diff --git a/docs/formatdomain.html.in b/docs/formatdomain.html.in index 58b8cb60771620037b2575d2b6b01979d53c30fe..fd2dd339c718eece81861e0c6927db5b85b98524 100644 --- a/docs/formatdomain.html.in +++ b/docs/formatdomain.html.in @@ -5126,11 +5126,10 @@ qemu-kvm -net nic,model=? /dev/null the TCP port number (with -1 as legacy syntax indicating that it should be auto-allocated). The autoport attribute is the new preferred syntax for indicating auto-allocation of the TCP - port to use. The listen attribute is an IP address - for the server to listen on. The passwd attribute - provides a VNC password in clear text. The keymap - attribute specifies the keymap to use. It is possible to set - a limit on the validity of the password by giving an timestamp + port to use. The passwd attribute provides a VNC + password in clear text. The keymap attribute specifies + the keymap to use. It is possible to set a limit on the validity of + the password by giving an timestamp passwdValidTo='2010-04-09T15:51:00' assumed to be in UTC. The connected attribute allows control of connected client during password changes. VNC accepts @@ -5168,14 +5167,12 @@ qemu-kvm -net nic,model=? /dev/null should be auto-allocated), while tlsPort gives an alternative secure port number. The autoport attribute is the new preferred syntax for indicating - auto-allocation of needed port numbers. The listen - attribute is an IP address for the server to listen on. - The passwd attribute provides a SPICE password in - clear text. The keymap attribute specifies the keymap - to use. It is possible to set a limit on the validity of - the password by giving an timestamp - passwdValidTo='2010-04-09T15:51:00' assumed to be in - UTC. + auto-allocation of needed port numbers. The passwd + attribute provides a SPICE password in clear text. The + keymap attribute specifies the keymap to use. It is + possible to set a limit on the validity of the password by giving + an timestamp passwdValidTo='2010-04-09T15:51:00' + assumed to be in UTC.

The connected attribute allows control of connected @@ -5312,6 +5309,15 @@ qemu-kvm -net nic,model=? /dev/null or hostname (which will be resolved to an IP address via a DNS query) to listen on.

+

+ It is possible to omit the address attribute in order to + use an address from config files Since 1.3.5. +

+

+ The address attribute is duplicated as listen + attribute in graphics element for backward compatibility. + If both are provided they must be equal. +

network
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng index 8798001d7ded78ae560066d42f717a08161319d8..903fd7ebe6179d0233dcde1598bb029659f3fd21 100644 --- a/docs/schemas/domaincommon.rng +++ b/docs/schemas/domaincommon.rng @@ -2952,9 +2952,11 @@ address - - - + + + + + diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c index b6f02677e75b921f9b08d6df89d3be86197b6385..0967e32366912727158d6934ad7c9a014cdc8b0e 100644 --- a/src/conf/domain_conf.c +++ b/src/conf/domain_conf.c @@ -10800,8 +10800,7 @@ virDomainGraphicsListensParseXML(virDomainGraphicsDefPtr def, if (STREQ_NULLABLE(newListen.address, "")) VIR_FREE(newListen.address); - if (newListen.address && - VIR_APPEND_ELEMENT(def->listens, def->nListens, newListen) < 0) + if (VIR_APPEND_ELEMENT(def->listens, def->nListens, newListen) < 0) goto error; } diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index eddf3a7b095b763e9746905510456d239f4e2ec7..f4bf6c1663ed8d62832a47a3c43acd7738d208df 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -4394,7 +4394,7 @@ qemuProcessSetupGraphics(virQEMUDriverPtr driver, { virQEMUDriverConfigPtr cfg = virQEMUDriverGetConfig(driver); bool allocate = !(flags & VIR_QEMU_PROCESS_START_PRETEND); - size_t i; + size_t i, j; int ret = -1; if (allocate && qemuProcessGraphicsReservePorts(driver, vm) < 0) @@ -4426,12 +4426,16 @@ qemuProcessSetupGraphics(virQEMUDriverPtr driver, break; } - if (graphics->nListens == 0 && listenAddr) { - if (virDomainGraphicsListenAppendAddress(graphics, - listenAddr) < 0) - goto cleanup; + for (j = 0; j < graphics->nListens; j++) { + virDomainGraphicsListenDefPtr glisten = &graphics->listens[j]; - graphics->listens[0].fromConfig = true; + if (glisten->type == VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS && + !glisten->address && listenAddr) { + if (VIR_STRDUP(glisten->address, listenAddr) < 0) + goto cleanup; + + glisten->fromConfig = true; + } } } diff --git a/src/vbox/vbox_common.c b/src/vbox/vbox_common.c index ed22724779bc599eefbc74721b20afb32c75db7d..13c3fec98d38ab9518cabdd57a7f8feed257fd0c 100644 --- a/src/vbox/vbox_common.c +++ b/src/vbox/vbox_common.c @@ -3385,8 +3385,10 @@ vboxDumpDisplay(virDomainDefPtr def, vboxGlobalData *data, IMachine *machine) VBOX_UTF16_FREE(netAddressUtf16); } - if (STRNEQ_NULLABLE(netAddressUtf8, "") && - virDomainGraphicsListenAppendAddress(graphics, netAddressUtf8) < 0) + if (netAddressUtf8 && STREQ(netAddressUtf8, "")) + VBOX_UTF8_FREE(netAddressUtf8); + + if (virDomainGraphicsListenAppendAddress(graphics, netAddressUtf8) < 0) goto cleanup; gVBoxAPI.UIVRDxServer.GetAllowMultiConnection(VRDxServer, &allowMultiConnection); diff --git a/src/vmx/vmx.c b/src/vmx/vmx.c index 5e57c3902ee835eda176f3577e712a5633a95c56..6505dd789fe8108d6a1a23579e9c2279526eaeb3 100644 --- a/src/vmx/vmx.c +++ b/src/vmx/vmx.c @@ -1875,11 +1875,9 @@ virVMXParseVNC(virConfPtr conf, virDomainGraphicsDefPtr *def) goto failure; } - if (listenAddr) { - if (virDomainGraphicsListenAppendAddress(*def, listenAddr) < 0) - goto failure; - VIR_FREE(listenAddr); - } + if (virDomainGraphicsListenAppendAddress(*def, listenAddr) < 0) + goto failure; + VIR_FREE(listenAddr); if (port < 0) { VIR_WARN("VNC is enabled but VMX entry 'RemoteDisplay.vnc.port' " diff --git a/src/xenconfig/xen_common.c b/src/xenconfig/xen_common.c index c6aee69254dd1e9e0b4128552daadc38933df105..c753fa8de03c43b95a6ba2d7b37495859a13b923 100644 --- a/src/xenconfig/xen_common.c +++ b/src/xenconfig/xen_common.c @@ -594,8 +594,7 @@ xenParseVfb(virConfPtr conf, virDomainDefPtr def) if (xenConfigCopyStringOpt(conf, "vnclisten", &listenAddr) < 0) goto cleanup; - if (listenAddr && - virDomainGraphicsListenAppendAddress(graphics, listenAddr) < 0) + if (virDomainGraphicsListenAppendAddress(graphics, listenAddr) < 0) goto cleanup; VIR_FREE(listenAddr); @@ -664,8 +663,7 @@ xenParseVfb(virConfPtr conf, virDomainDefPtr def) if (STREQ(key + 10, "1")) graphics->data.vnc.autoport = true; } else if (STRPREFIX(key, "vnclisten=")) { - if (virDomainGraphicsListenAppendAddress(graphics, - key+10) < 0) + if (VIR_STRDUP(listenAddr, key+10) < 0) goto cleanup; } else if (STRPREFIX(key, "vncpasswd=")) { if (VIR_STRDUP(graphics->data.vnc.auth.passwd, key + 10) < 0) @@ -699,6 +697,12 @@ xenParseVfb(virConfPtr conf, virDomainDefPtr def) nextkey++; key = nextkey; } + if (graphics->type == VIR_DOMAIN_GRAPHICS_TYPE_VNC) { + if (virDomainGraphicsListenAppendAddress(graphics, + listenAddr) < 0) + goto cleanup; + VIR_FREE(listenAddr); + } if (VIR_ALLOC_N(def->graphics, 1) < 0) goto cleanup; def->graphics[0] = graphics; diff --git a/src/xenconfig/xen_sxpr.c b/src/xenconfig/xen_sxpr.c index d4aa5e99f08c8e038380defab0dcb23a6df62891..8b5e06326dc7dced68b83207c7507eeea802bfe2 100644 --- a/src/xenconfig/xen_sxpr.c +++ b/src/xenconfig/xen_sxpr.c @@ -867,8 +867,7 @@ xenParseSxprGraphicsOld(virDomainDefPtr def, graphics->data.vnc.autoport = true; graphics->data.vnc.port = port; - if (listenAddr && - virDomainGraphicsListenAppendAddress(graphics, listenAddr) < 0) + if (virDomainGraphicsListenAppendAddress(graphics, listenAddr) < 0) goto error; if (VIR_STRDUP(graphics->data.vnc.auth.passwd, vncPasswd) < 0) @@ -988,8 +987,7 @@ xenParseSxprGraphicsNew(virDomainDefPtr def, port += 5900; graphics->data.vnc.port = port; - if (listenAddr && - virDomainGraphicsListenAppendAddress(graphics, listenAddr) < 0) + if (virDomainGraphicsListenAppendAddress(graphics, listenAddr) < 0) goto error; if (VIR_STRDUP(graphics->data.vnc.auth.passwd, vncPasswd) < 0) diff --git a/src/xenconfig/xen_xl.c b/src/xenconfig/xen_xl.c index 889dd400fcd7cbfe4890875a46bd02586ae9d21c..7d41e0504ed1a8760170c3610ce2f57b210bb27f 100644 --- a/src/xenconfig/xen_xl.c +++ b/src/xenconfig/xen_xl.c @@ -186,8 +186,7 @@ xenParseXLSpice(virConfPtr conf, virDomainDefPtr def) graphics->type = VIR_DOMAIN_GRAPHICS_TYPE_SPICE; if (xenConfigCopyStringOpt(conf, "spicehost", &listenAddr) < 0) goto cleanup; - if (listenAddr && - virDomainGraphicsListenAppendAddress(graphics, listenAddr) < 0) + if (virDomainGraphicsListenAppendAddress(graphics, listenAddr) < 0) goto cleanup; VIR_FREE(listenAddr); diff --git a/tests/genericxml2xmloutdata/generic-graphics-vnc-manual-port.xml b/tests/genericxml2xmloutdata/generic-graphics-vnc-manual-port.xml index ac8c27960e48c875f576ee46a1e935836f392e7f..73010576f8e7200c986d60f1259ddd5a3d8ba593 100644 --- a/tests/genericxml2xmloutdata/generic-graphics-vnc-manual-port.xml +++ b/tests/genericxml2xmloutdata/generic-graphics-vnc-manual-port.xml @@ -19,7 +19,9 @@ - + + + diff --git a/tests/genericxml2xmloutdata/generic-graphics-vnc-minimal.xml b/tests/genericxml2xmloutdata/generic-graphics-vnc-minimal.xml index ac8c27960e48c875f576ee46a1e935836f392e7f..73010576f8e7200c986d60f1259ddd5a3d8ba593 100644 --- a/tests/genericxml2xmloutdata/generic-graphics-vnc-minimal.xml +++ b/tests/genericxml2xmloutdata/generic-graphics-vnc-minimal.xml @@ -19,7 +19,9 @@ - + + + diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-timeout.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-timeout.xml index 33b5465c5d90222d04da2962ccd6fab556347b44..912b542843b398dc5a5689dfb0c6042c5e29220d 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-timeout.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-graphics-spice-timeout.xml @@ -77,7 +77,9 @@ - + + +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-server.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-server.xml index 9bc610bbe2fecf41598bf52b8d3faa8724325018..95b6e2df1a911d7e0b11886b9c4c4a3552e1f25a 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-server.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-interface-server.xml @@ -119,7 +119,9 @@ - + + +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth.xml index b9c90159ff6fe11ae33551eee3bc8986185b8d64..1fb740b9d6f066bb3e8ad7bf72f90536eaa517ad 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth.xml @@ -63,7 +63,9 @@ - + + +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth2.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth2.xml index 411b409a2c6256154ff09bc7338b51834ac472cb..6464890ef0056459aa972b4f762642d67a4930da 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth2.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-net-bandwidth2.xml @@ -52,7 +52,9 @@ - + + +
diff --git a/tests/qemuxml2xmloutdata/qemuxml2xmlout-video-virtio-gpu-spice-gl.xml b/tests/qemuxml2xmloutdata/qemuxml2xmlout-video-virtio-gpu-spice-gl.xml index 4b06e480ba1efa9861d005549d3871224c50d723..a6dddab5628ed0b0df14da6025e237f9514d44f0 100644 --- a/tests/qemuxml2xmloutdata/qemuxml2xmlout-video-virtio-gpu-spice-gl.xml +++ b/tests/qemuxml2xmloutdata/qemuxml2xmlout-video-virtio-gpu-spice-gl.xml @@ -30,6 +30,7 @@ +