mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
qemu: Escape commas for qemuBuildChrChardevStr
Add comma escaping for dev->data.file.path in cases VIR_DOMAIN_CHR_TYPE_DEV and VIR_DOMAIN_CHR_TYPE_PIPE. Signed-off-by: Anya Harter <aharter@redhat.com> Reviewed-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
22b7247d48
commit
452dac71cd
@ -4975,9 +4975,10 @@ qemuBuildChrChardevStr(virLogManagerPtr logManager,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_CHR_TYPE_DEV:
|
case VIR_DOMAIN_CHR_TYPE_DEV:
|
||||||
virBufferAsprintf(&buf, "%s,id=%s,path=%s",
|
virBufferAsprintf(&buf, "%s,id=%s,path=",
|
||||||
STRPREFIX(alias, "parallel") ? "parport" : "tty",
|
STRPREFIX(alias, "parallel") ? "parport" : "tty",
|
||||||
charAlias, dev->data.file.path);
|
charAlias);
|
||||||
|
virQEMUBuildBufferEscapeComma(&buf, dev->data.file.path);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_CHR_TYPE_FILE:
|
case VIR_DOMAIN_CHR_TYPE_FILE:
|
||||||
@ -4997,8 +4998,8 @@ qemuBuildChrChardevStr(virLogManagerPtr logManager,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_CHR_TYPE_PIPE:
|
case VIR_DOMAIN_CHR_TYPE_PIPE:
|
||||||
virBufferAsprintf(&buf, "pipe,id=%s,path=%s", charAlias,
|
virBufferAsprintf(&buf, "pipe,id=%s,path=", charAlias);
|
||||||
dev->data.file.path);
|
virQEMUBuildBufferEscapeComma(&buf, dev->data.file.path);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_CHR_TYPE_STDIO:
|
case VIR_DOMAIN_CHR_TYPE_STDIO:
|
||||||
|
@ -23,6 +23,10 @@ bar=2/monitor.sock,server,nowait \
|
|||||||
-no-acpi \
|
-no-acpi \
|
||||||
-boot c \
|
-boot c \
|
||||||
-usb \
|
-usb \
|
||||||
|
-chardev tty,id=charserial0,path=/dev/ttyS2,,foo \
|
||||||
|
-device isa-serial,chardev=charserial0,id=serial0 \
|
||||||
|
-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 \
|
-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 \
|
-spice unix,addr=/tmp/lib/domain--1-foo=1,,bar=2/spice.sock \
|
||||||
-vga cirrus \
|
-vga cirrus \
|
||||||
|
@ -20,5 +20,12 @@
|
|||||||
<graphics type='spice'>
|
<graphics type='spice'>
|
||||||
<listen type='socket'/>
|
<listen type='socket'/>
|
||||||
</graphics>
|
</graphics>
|
||||||
|
<serial type='dev'>
|
||||||
|
<source path='/dev/ttyS2,foo'/>
|
||||||
|
</serial>
|
||||||
|
<channel type='pipe'>
|
||||||
|
<source path='/tmp/guestfwd,foo'/>
|
||||||
|
<target type='guestfwd' address='10.0.2.1' port='4600'/>
|
||||||
|
</channel>
|
||||||
</devices>
|
</devices>
|
||||||
</domain>
|
</domain>
|
||||||
|
@ -2762,7 +2762,8 @@ mymain(void)
|
|||||||
QEMU_CAPS_NAME_GUEST,
|
QEMU_CAPS_NAME_GUEST,
|
||||||
QEMU_CAPS_DEVICE_CIRRUS_VGA,
|
QEMU_CAPS_DEVICE_CIRRUS_VGA,
|
||||||
QEMU_CAPS_SPICE,
|
QEMU_CAPS_SPICE,
|
||||||
QEMU_CAPS_SPICE_UNIX);
|
QEMU_CAPS_SPICE_UNIX,
|
||||||
|
QEMU_CAPS_DEVICE_ISA_SERIAL);
|
||||||
DO_TEST("debug-threads", QEMU_CAPS_NAME_DEBUG_THREADS);
|
DO_TEST("debug-threads", QEMU_CAPS_NAME_DEBUG_THREADS);
|
||||||
|
|
||||||
DO_TEST("master-key", QEMU_CAPS_OBJECT_SECRET);
|
DO_TEST("master-key", QEMU_CAPS_OBJECT_SECRET);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user