the TCP port number (with -1 as legacy syntax indicating that it
should be auto-allocated). The <code>autoport</code> attribute is
the new preferred syntax for indicating auto-allocation of the TCP
- port to use. The <code>listen</code> attribute is an IP address
- for the server to listen on. The <code>passwd</code> attribute
- provides a VNC password in clear text. The <code>keymap</code>
- 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 <code>passwd</code> attribute provides a VNC
+ password in clear text. The <code>keymap</code> attribute specifies
+ the keymap to use. It is possible to set a limit on the validity of
+ the password by giving an timestamp
<code>passwdValidTo='2010-04-09T15:51:00'</code> assumed to be
in UTC. The <code>connected</code> attribute allows control of
connected client during password changes. VNC accepts
should be auto-allocated), while <code>tlsPort</code> gives
an alternative secure port number. The <code>autoport</code>
attribute is the new preferred syntax for indicating
- auto-allocation of needed port numbers. The <code>listen</code>
- attribute is an IP address for the server to listen on.
- The <code>passwd</code> attribute provides a SPICE password in
- clear text. The <code>keymap</code> attribute specifies the keymap
- to use. It is possible to set a limit on the validity of
- the password by giving an timestamp
- <code>passwdValidTo='2010-04-09T15:51:00'</code> assumed to be in
- UTC.
+ auto-allocation of needed port numbers. The <code>passwd</code>
+ attribute provides a SPICE password in clear text. The
+ <code>keymap</code> attribute specifies the keymap to use. It is
+ possible to set a limit on the validity of the password by giving
+ an timestamp <code>passwdValidTo='2010-04-09T15:51:00'</code>
+ assumed to be in UTC.
</p>
<p>
The <code>connected</code> attribute allows control of connected
or hostname (which will be resolved to an IP address via a DNS query)
to listen on.
</p>
+ <p>
+ It is possible to omit the <code>address</code> attribute in order to
+ use an address from config files <span class="since">Since 1.3.5</span>.
+ </p>
+ <p>
+ The <code>address</code> attribute is duplicated as <code>listen</code>
+ attribute in <code>graphics</code> element for backward compatibility.
+ If both are provided they must be equal.
+ </p>
</dd>
<dt><code>network</code></dt>
<dd>
<attribute name="type">
<value>address</value>
</attribute>
- <attribute name="address">
- <ref name="addrIPorName"/>
- </attribute>
+ <optional>
+ <attribute name="address">
+ <ref name="addrIPorName"/>
+ </attribute>
+ </optional>
</group>
<group>
<attribute name="type">
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;
}
{
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)
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;
+ }
}
}
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);
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' "
if (xenConfigCopyStringOpt(conf, "vnclisten", &listenAddr) < 0)
goto cleanup;
- if (listenAddr &&
- virDomainGraphicsListenAppendAddress(graphics, listenAddr) < 0)
+ if (virDomainGraphicsListenAppendAddress(graphics, listenAddr) < 0)
goto cleanup;
VIR_FREE(listenAddr);
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)
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;
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)
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)
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);
<controller type='pci' index='0' model='pci-root'/>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes'/>
+ <graphics type='vnc' port='-1' autoport='yes'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
<controller type='pci' index='0' model='pci-root'/>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes'/>
+ <graphics type='vnc' port='-1' autoport='yes'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
<input type='tablet' bus='usb'/>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='spice' port='5900' autoport='no' passwd='sercet' passwdValidTo='2011-05-31T16:11:22' connected='disconnect'/>
+ <graphics type='spice' port='5900' autoport='no' passwd='sercet' passwdValidTo='2011-05-31T16:11:22' connected='disconnect'>
+ <listen type='address'/>
+ </graphics>
<sound model='ac97'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</sound>
</channel>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes'/>
+ <graphics type='vnc' port='-1' autoport='yes'>
+ <listen type='address'/>
+ </graphics>
<sound model='ich6'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x04' function='0x0'/>
</sound>
<input type='tablet' bus='usb'/>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes'/>
+ <graphics type='vnc' port='-1' autoport='yes'>
+ <listen type='address'/>
+ </graphics>
<sound model='ac97'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</sound>
<input type='tablet' bus='usb'/>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes'/>
+ <graphics type='vnc' port='-1' autoport='yes'>
+ <listen type='address'/>
+ </graphics>
<sound model='ac97'>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</sound>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
<graphics type='spice' autoport='no'>
+ <listen type='address'/>
<gl enable='yes'/>
</graphics>
<video>
</console>
<input type='mouse' bus='xen'/>
<input type='keyboard' bus='xen'/>
- <graphics type='vnc' port='-1' autoport='yes'/>
+ <graphics type='vnc' port='-1' autoport='yes'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='xen' vram='4096' heads='1' primary='yes'/>
</video>
<input type='tablet' bus='usb'/>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='5925' autoport='yes' keymap='en-us'/>
+ <graphics type='vnc' port='5925' autoport='yes' keymap='en-us'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
</interface>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes' keymap='ja'/>
+ <graphics type='vnc' port='-1' autoport='yes' keymap='ja'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
</interface>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes'/>
+ <graphics type='vnc' port='-1' autoport='yes'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
</interface>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes'/>
+ <graphics type='vnc' port='-1' autoport='yes'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
</interface>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes' keymap='ja'/>
+ <graphics type='vnc' port='-1' autoport='yes' keymap='ja'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
</interface>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes' keymap='ja'/>
+ <graphics type='vnc' port='-1' autoport='yes' keymap='ja'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
</parallel>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes'/>
+ <graphics type='vnc' port='-1' autoport='yes'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
</console>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes'/>
+ <graphics type='vnc' port='-1' autoport='yes'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
</console>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes'/>
+ <graphics type='vnc' port='-1' autoport='yes'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
</console>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes'/>
+ <graphics type='vnc' port='-1' autoport='yes'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
</console>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes'/>
+ <graphics type='vnc' port='-1' autoport='yes'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
</console>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes'/>
+ <graphics type='vnc' port='-1' autoport='yes'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
</console>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes'/>
+ <graphics type='vnc' port='-1' autoport='yes'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
</console>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes'/>
+ <graphics type='vnc' port='-1' autoport='yes'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
</console>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes'/>
+ <graphics type='vnc' port='-1' autoport='yes'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
</console>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes'/>
+ <graphics type='vnc' port='-1' autoport='yes'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
</console>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes'/>
+ <graphics type='vnc' port='-1' autoport='yes'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
</console>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes'/>
+ <graphics type='vnc' port='-1' autoport='yes'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
</interface>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes' keymap='ja'/>
+ <graphics type='vnc' port='-1' autoport='yes' keymap='ja'>
+ <listen type='address'/>
+ </graphics>
<sound model='sb16'/>
<sound model='es1370'/>
<video>
</interface>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes' keymap='ja'/>
+ <graphics type='vnc' port='-1' autoport='yes' keymap='ja'>
+ <listen type='address'/>
+ </graphics>
<sound model='sb16'/>
<sound model='es1370'/>
<video>
<input type='mouse' bus='usb'/>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes' keymap='ja'/>
+ <graphics type='vnc' port='-1' autoport='yes' keymap='ja'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
<input type='tablet' bus='usb'/>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes' keymap='ja'/>
+ <graphics type='vnc' port='-1' autoport='yes' keymap='ja'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
</interface>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes' keymap='ja'/>
+ <graphics type='vnc' port='-1' autoport='yes' keymap='ja'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
</interface>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes' keymap='ja'/>
+ <graphics type='vnc' port='-1' autoport='yes' keymap='ja'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
</interface>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes' keymap='ja'/>
+ <graphics type='vnc' port='-1' autoport='yes' keymap='ja'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
</console>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes'/>
+ <graphics type='vnc' port='-1' autoport='yes'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
</console>
<input type='mouse' bus='xen'/>
<input type='keyboard' bus='xen'/>
- <graphics type='vnc' port='-1' autoport='yes'/>
+ <graphics type='vnc' port='-1' autoport='yes'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='xen' vram='4096' heads='1' primary='yes'/>
</video>
</interface>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes' keymap='ja'/>
+ <graphics type='vnc' port='-1' autoport='yes' keymap='ja'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
- <graphics type='vnc' port='5903' autoport='no' keymap='de' passwd='password'/>
+ <graphics type='vnc' port='5903' autoport='no' keymap='de' passwd='password'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='vmvga' vram='4096' primary='yes'/>
</video>
</console>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes'/>
+ <graphics type='vnc' port='-1' autoport='yes'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>
</console>
<input type='mouse' bus='ps2'/>
<input type='keyboard' bus='ps2'/>
- <graphics type='vnc' port='-1' autoport='yes'/>
+ <graphics type='vnc' port='-1' autoport='yes'>
+ <listen type='address'/>
+ </graphics>
<video>
<model type='cirrus' vram='16384' heads='1' primary='yes'/>
</video>