1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

qemu: Escape commas for qemuBuildGrapicsSPICECommandLine

Add comma escaping for cfg->spiceTLSx509certdir and
graphics->data.spice.rendernode.

Signed-off-by: Anya Harter <aharter@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
Anya Harter 2018-06-18 13:57:26 -04:00 committed by John Ferlan
parent 0234a2754b
commit 23f55840f5
4 changed files with 17 additions and 5 deletions

View File

@ -7974,8 +7974,11 @@ qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfigPtr cfg,
!cfg->spicePassword)
virBufferAddLit(&opt, "disable-ticketing,");
if (hasSecure)
virBufferAsprintf(&opt, "x509-dir=%s,", cfg->spiceTLSx509certdir);
if (hasSecure) {
virBufferAddLit(&opt, "x509-dir=");
virQEMUBuildBufferEscapeComma(&opt, cfg->spiceTLSx509certdir);
virBufferAddLit(&opt, ",");
}
switch (graphics->data.spice.defaultMode) {
case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_SECURE:
@ -8082,7 +8085,9 @@ qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfigPtr cfg,
goto error;
}
virBufferAsprintf(&opt, "rendernode=%s,", graphics->data.spice.rendernode);
virBufferAddLit(&opt, "rendernode=");
virQEMUBuildBufferEscapeComma(&opt, graphics->data.spice.rendernode);
virBufferAddLit(&opt, ",");
}
}

View File

@ -33,6 +33,7 @@ cert3=cert3,db=/etc/pki/nssdb,,foo,id=smartcard0,bus=ccid0.0 \
-chardev pipe,id=charchannel0,path=/tmp/guestfwd,,foo \
-netdev user,guestfwd=tcp:10.0.2.1:4600-chardev:charchannel0,id=user-channel0 \
-vnc unix:/tmp/lib/domain--1-foo=1,,bar=2/vnc.sock \
-spice unix,addr=/tmp/lib/domain--1-foo=1,,bar=2/spice.sock \
-vga cirrus \
-spice unix,addr=/tmp/lib/domain--1-foo=1,,bar=2/spice.sock,gl=on,\
rendernode=/dev/dri/foo,,bar \
-device cirrus-vga,id=video0,bus=pci.0,addr=0x2 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3

View File

@ -19,6 +19,7 @@
</graphics>
<graphics type='spice'>
<listen type='socket'/>
<gl enable='yes' rendernode='/dev/dri/foo,bar'/>
</graphics>
<serial type='dev'>
<source path='/dev/ttyS2,foo'/>

View File

@ -2763,6 +2763,11 @@ mymain(void)
QEMU_CAPS_DEVICE_CIRRUS_VGA,
QEMU_CAPS_SPICE,
QEMU_CAPS_SPICE_UNIX,
QEMU_CAPS_DEVICE_VIRTIO_GPU,
QEMU_CAPS_VIRTIO_GPU_VIRGL,
QEMU_CAPS_SPICE_GL,
QEMU_CAPS_SPICE_RENDERNODE,
QEMU_CAPS_DEVICE_VIDEO_PRIMARY,
QEMU_CAPS_DEVICE_ISA_SERIAL,
QEMU_CAPS_CHARDEV_FILE_APPEND,
QEMU_CAPS_CCID_EMULATED);