!cfg->spicePassword)
virBufferAddLit(&opt, ",disable-ticketing");
- if (cfg->spiceTLS)
- virBufferAsprintf(&opt, ",x509-dir=%s",
- cfg->spiceTLSx509certdir);
+ if (tlsPort > 0)
+ virBufferAsprintf(&opt, ",x509-dir=%s", cfg->spiceTLSx509certdir);
switch (defaultMode) {
case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_SECURE:
}
for (i = 0 ; i < VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_LAST ; i++) {
- int mode = graphics->data.spice.channels[i];
- switch (mode) {
+ switch (graphics->data.spice.channels[i]) {
case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_SECURE:
- if (!cfg->spiceTLS) {
+ if (tlsPort <= 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("spice secure channels set in XML configuration, "
- "but TLS is disabled in qemu.conf"));
+ "but TLS port is not provided"));
goto error;
}
virBufferAsprintf(&opt, ",tls-channel=%s",
virDomainGraphicsSpiceChannelNameTypeToString(i));
break;
+
case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_INSECURE:
+ if (port <= 0) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("spice insecure channels set in XML "
+ "configuration, but plain port is not provided"));
+ goto error;
+ }
virBufferAsprintf(&opt, ",plaintext-channel=%s",
virDomainGraphicsSpiceChannelNameTypeToString(i));
break;
+
+ case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_ANY:
+ switch (defaultMode) {
+ case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_SECURE:
+ if (tlsPort <= 0) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("spice defaultMode secure requested in XML "
+ "configuration but TLS port not provided"));
+ goto error;
+ }
+ break;
+
+ case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_INSECURE:
+ if (port <= 0) {
+ virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
+ _("spice defaultMode insecure requested in XML "
+ "configuration but plain port not provided"));
+ goto error;
+ }
+ break;
+
+ case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_ANY:
+ /* don't care */
+ break;
+ }
}
}
+
if (graphics->data.spice.image)
virBufferAsprintf(&opt, ",image-compression=%s",
virDomainGraphicsSpiceImageCompressionTypeToString(graphics->data.spice.image));
spicevmc,id=charchannel0,name=vdagent -device \
virtserialport,bus=virtio-serial0.0,nr=1,chardev=charchannel0,id=channel0,name=com.redhat.spice.0 \
-device usb-tablet,id=input0 -spice \
-port=0,addr=0.0.0.0,x509-dir=/etc/pki/libvirt-spice -device \
+port=0,addr=0.0.0.0 -device \
intel-hda,id=sound0,bus=pci.0,addr=0x4 -device \
hda-duplex,id=sound0-codec0,bus=sound0.0,cad=0 -device \
usb-host,hostbus=14,hostaddr=6,id=hostdev0 -device \
-device rtl8139,vlan=0,id=net0,mac=52:54:00:71:70:89,bus=pci.0,addr=0x7 \
-net tap,script=/etc/qemu-ifup,vlan=0,name=hostnet0 -serial pty \
-device usb-tablet,id=input0 \
--spice port=5900,x509-dir=/etc/pki/libvirt-spice -vga std \
+-spice port=5900 -vga std \
-device AC97,id=sound0,bus=pci.0,addr=0x3 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5