qemu: skip only ',' for VNC and Spice unix socket

Commit 824272cb28 attempted to fix escaping of characters in unix
socket path but it was wrong.  We need to escape only ',', there is
no escape character for '='.

Signed-off-by: Pavel Hrdina <phrdina@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
Pavel Hrdina 2017-06-10 11:38:57 +02:00
parent 382bdbfe7b
commit 8f827f2ace
2 changed files with 4 additions and 4 deletions

View File

@ -7927,7 +7927,7 @@ qemuBuildGraphicsVNCCommandLine(virQEMUDriverConfigPtr cfg,
switch (glisten->type) {
case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_SOCKET:
virBufferAddLit(&opt, "unix:");
virQEMUBuildBufferEscape(&opt, glisten->socket);
virQEMUBuildBufferEscapeComma(&opt, glisten->socket);
break;
case VIR_DOMAIN_GRAPHICS_LISTEN_TYPE_ADDRESS:
@ -8060,7 +8060,7 @@ qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfigPtr cfg,
}
virBufferAddLit(&opt, "unix,addr=");
virQEMUBuildBufferEscape(&opt, glisten->socket);
virQEMUBuildBufferEscapeComma(&opt, glisten->socket);
virBufferAddLit(&opt, ",");
hasInsecure = true;
break;

View File

@ -20,7 +20,7 @@ bar=2/monitor.sock,server,nowait \
-no-acpi \
-boot c \
-usb \
-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' \
-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 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3