mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
qemu: Omit SPICE address if no port is specified
Currently -spice addr=127.0.0.1 is generated, but spice-server is going to ignore this as no port is specified.
This commit is contained in:
parent
9e17d219b3
commit
8dab3d1d19
@ -7411,41 +7411,43 @@ qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfigPtr cfg,
|
|||||||
/* TODO: Support ACLs later */
|
/* TODO: Support ACLs later */
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (virDomainGraphicsListenGetType(graphics, 0)) {
|
if (port > 0 || tlsPort > 0) {
|
||||||
case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS:
|
switch (virDomainGraphicsListenGetType(graphics, 0)) {
|
||||||
listenAddr = virDomainGraphicsListenGetAddress(graphics, 0);
|
case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS:
|
||||||
break;
|
listenAddr = virDomainGraphicsListenGetAddress(graphics, 0);
|
||||||
|
break;
|
||||||
case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK:
|
|
||||||
listenNetwork = virDomainGraphicsListenGetNetwork(graphics, 0);
|
case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_NETWORK:
|
||||||
if (!listenNetwork)
|
listenNetwork = virDomainGraphicsListenGetNetwork(graphics, 0);
|
||||||
|
if (!listenNetwork)
|
||||||
|
break;
|
||||||
|
ret = networkGetNetworkAddress(listenNetwork, &netAddr);
|
||||||
|
if (ret <= -2) {
|
||||||
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
|
"%s", _("network-based listen not possible, "
|
||||||
|
"network driver not present"));
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
if (ret < 0)
|
||||||
|
goto error;
|
||||||
|
|
||||||
|
listenAddr = netAddr;
|
||||||
|
/* store the address we found in the <graphics> element so it will
|
||||||
|
* show up in status. */
|
||||||
|
if (virDomainGraphicsListenSetAddress(graphics, 0,
|
||||||
|
listenAddr, -1, false) < 0)
|
||||||
|
goto error;
|
||||||
break;
|
break;
|
||||||
ret = networkGetNetworkAddress(listenNetwork, &netAddr);
|
|
||||||
if (ret <= -2) {
|
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
|
||||||
"%s", _("network-based listen not possible, "
|
|
||||||
"network driver not present"));
|
|
||||||
goto error;
|
|
||||||
}
|
}
|
||||||
if (ret < 0)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
listenAddr = netAddr;
|
if (!listenAddr)
|
||||||
/* store the address we found in the <graphics> element so it will
|
listenAddr = cfg->spiceListen;
|
||||||
* show up in status. */
|
if (listenAddr)
|
||||||
if (virDomainGraphicsListenSetAddress(graphics, 0,
|
virBufferAsprintf(&opt, "addr=%s,", listenAddr);
|
||||||
listenAddr, -1, false) < 0)
|
|
||||||
goto error;
|
VIR_FREE(netAddr);
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!listenAddr)
|
|
||||||
listenAddr = cfg->spiceListen;
|
|
||||||
if (listenAddr)
|
|
||||||
virBufferAsprintf(&opt, "addr=%s,", listenAddr);
|
|
||||||
|
|
||||||
VIR_FREE(netAddr);
|
|
||||||
|
|
||||||
if (graphics->data.spice.mousemode) {
|
if (graphics->data.spice.mousemode) {
|
||||||
switch (graphics->data.spice.mousemode) {
|
switch (graphics->data.spice.mousemode) {
|
||||||
case VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_SERVER:
|
case VIR_DOMAIN_GRAPHICS_SPICE_MOUSE_MODE_SERVER:
|
||||||
|
@ -37,7 +37,7 @@ media=cdrom,id=drive-ide0-1-0 \
|
|||||||
-device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,\
|
-device virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,\
|
||||||
id=channel0,name=com.redhat.spice.0 \
|
id=channel0,name=com.redhat.spice.0 \
|
||||||
-device usb-tablet,id=input0 \
|
-device usb-tablet,id=input0 \
|
||||||
-spice port=0,addr=0.0.0.0 \
|
-spice port=0 \
|
||||||
-vga cirrus \
|
-vga cirrus \
|
||||||
-device intel-hda,id=sound0,bus=pci.0,addr=0x4 \
|
-device intel-hda,id=sound0,bus=pci.0,addr=0x4 \
|
||||||
-device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 \
|
-device hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user