qemu: properly escape socket path for graphics
Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=1352529 Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
This commit is contained in:
parent
22b02f4492
commit
824272cb28
@ -7495,7 +7495,7 @@ qemuBuildGraphicsVNCCommandLine(virQEMUDriverConfigPtr cfg,
|
|||||||
switch (glisten->type) {
|
switch (glisten->type) {
|
||||||
case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET:
|
case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET:
|
||||||
virBufferAddLit(&opt, "unix:");
|
virBufferAddLit(&opt, "unix:");
|
||||||
virQEMUBuildBufferEscapeComma(&opt, glisten->socket);
|
virQEMUBuildBufferEscape(&opt, glisten->socket);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS:
|
case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS:
|
||||||
@ -7627,7 +7627,9 @@ qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfigPtr cfg,
|
|||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
virBufferAsprintf(&opt, "unix,addr=%s,", glisten->socket);
|
virBufferAddLit(&opt, "unix,addr=");
|
||||||
|
virQEMUBuildBufferEscape(&opt, glisten->socket);
|
||||||
|
virBufferAddLit(&opt, ",");
|
||||||
hasInsecure = true;
|
hasInsecure = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@ PATH=/bin \
|
|||||||
HOME=/home/test \
|
HOME=/home/test \
|
||||||
USER=test \
|
USER=test \
|
||||||
LOGNAME=test \
|
LOGNAME=test \
|
||||||
QEMU_AUDIO_DRV=none \
|
QEMU_AUDIO_DRV=spice \
|
||||||
/usr/bin/qemu \
|
/usr/bin/qemu \
|
||||||
-name guest=foo=1,,bar=2,debug-threads=on \
|
-name guest=foo=1,,bar=2,debug-threads=on \
|
||||||
-S \
|
-S \
|
||||||
@ -20,6 +20,7 @@ bar=2/monitor.sock,server,nowait \
|
|||||||
-no-acpi \
|
-no-acpi \
|
||||||
-boot c \
|
-boot c \
|
||||||
-usb \
|
-usb \
|
||||||
-vnc unix:/tmp/bar,,foo.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' \
|
||||||
-vga cirrus \
|
-vga cirrus \
|
||||||
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
|
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
|
||||||
|
@ -14,6 +14,11 @@
|
|||||||
<on_crash>destroy</on_crash>
|
<on_crash>destroy</on_crash>
|
||||||
<devices>
|
<devices>
|
||||||
<emulator>/usr/bin/qemu</emulator>
|
<emulator>/usr/bin/qemu</emulator>
|
||||||
<graphics type='vnc' socket='/tmp/bar,foo.sock'/>
|
<graphics type='vnc'>
|
||||||
|
<listen type='socket'/>
|
||||||
|
</graphics>
|
||||||
|
<graphics type='spice'>
|
||||||
|
<listen type='socket'/>
|
||||||
|
</graphics>
|
||||||
</devices>
|
</devices>
|
||||||
</domain>
|
</domain>
|
||||||
|
@ -2437,7 +2437,8 @@ mymain(void)
|
|||||||
|
|
||||||
DO_TEST("name-escape", QEMU_CAPS_NAME_DEBUG_THREADS,
|
DO_TEST("name-escape", QEMU_CAPS_NAME_DEBUG_THREADS,
|
||||||
QEMU_CAPS_OBJECT_SECRET, QEMU_CAPS_CHARDEV, QEMU_CAPS_VNC,
|
QEMU_CAPS_OBJECT_SECRET, QEMU_CAPS_CHARDEV, QEMU_CAPS_VNC,
|
||||||
QEMU_CAPS_NAME_GUEST, QEMU_CAPS_DEVICE_CIRRUS_VGA);
|
QEMU_CAPS_NAME_GUEST, QEMU_CAPS_DEVICE_CIRRUS_VGA,
|
||||||
|
QEMU_CAPS_SPICE, QEMU_CAPS_SPICE_UNIX);
|
||||||
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