qemu: command: escape commas in VNC socket path

This path can be dependent on the VM libdir, which contains its name
This commit is contained in:
Cole Robinson 2016-05-08 14:33:50 -04:00
parent 3153ac08c9
commit 077ba95677
4 changed files with 6 additions and 3 deletions

View File

@ -7425,7 +7425,8 @@ qemuBuildGraphicsVNCCommandLine(virQEMUDriverConfigPtr cfg,
graphics->data.vnc.socketAutogenerated = true;
}
virBufferAsprintf(&opt, "unix:%s", graphics->data.vnc.socket);
virBufferAddLit(&opt, "unix:");
qemuBufferEscapeComma(&opt, graphics->data.vnc.socket);
} else {
if (!graphics->data.vnc.autoport &&

View File

@ -13,7 +13,6 @@ bar/master-key.aes \
-m 214 \
-smp 1 \
-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \
-nographic \
-nodefaults \
-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-foo,bar/monitor.sock,\
server,nowait \
@ -21,4 +20,6 @@ server,nowait \
-no-acpi \
-boot c \
-usb \
-vnc unix:/tmp/bar,,foo.sock \
-vga cirrus \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3

View File

@ -14,5 +14,6 @@
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu</emulator>
<graphics type='vnc' socket='/tmp/bar,foo.sock'/>
</devices>
</domain>

View File

@ -1903,7 +1903,7 @@ mymain(void)
NONE);
DO_TEST("name-escape", QEMU_CAPS_NAME_DEBUG_THREADS,
QEMU_CAPS_OBJECT_SECRET, QEMU_CAPS_CHARDEV);
QEMU_CAPS_OBJECT_SECRET, QEMU_CAPS_CHARDEV, QEMU_CAPS_VNC);
DO_TEST("debug-threads", QEMU_CAPS_NAME_DEBUG_THREADS);
DO_TEST("master-key", QEMU_CAPS_OBJECT_SECRET);