From patchwork Sun May 8 18:43:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 67326 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp1260890qge; Sun, 8 May 2016 11:46:41 -0700 (PDT) X-Received: by 10.28.97.213 with SMTP id v204mr7678899wmb.50.1462733200977; Sun, 08 May 2016 11:46:40 -0700 (PDT) Return-Path: Received: from mx3-phx2.redhat.com (mx3-phx2.redhat.com. [209.132.183.24]) by mx.google.com with ESMTPS id o69si21950642wme.21.2016.05.08.11.46.40 (version=TLS1 cipher=AES128-SHA bits=128/128); Sun, 08 May 2016 11:46:40 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.24 as permitted sender) client-ip=209.132.183.24; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.24 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u48Ii9ft012440; Sun, 8 May 2016 14:44:09 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u48Ihlkn016830 for ; Sun, 8 May 2016 14:43:47 -0400 Received: from colepc.redhat.com (ovpn-113-25.phx2.redhat.com [10.3.113.25]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u48IhhIY024246; Sun, 8 May 2016 14:43:46 -0400 From: Cole Robinson To: libvirt-list@redhat.com Date: Sun, 8 May 2016 14:43:39 -0400 Message-Id: <546b4277303af6c57f838785b34a81ef9b57506b.1462732781.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v3 4/6] qemu: command: escape commas in VNC socket path X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com This path can be dependent on the VM libdir, which contains its name --- src/qemu/qemu_command.c | 3 ++- tests/qemuxml2argvdata/qemuxml2argv-name-escape.args | 3 ++- tests/qemuxml2argvdata/qemuxml2argv-name-escape.xml | 1 + tests/qemuxml2argvtest.c | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) -- 2.7.4 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 067a8c3..22fb51c 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7427,7 +7427,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 && diff --git a/tests/qemuxml2argvdata/qemuxml2argv-name-escape.args b/tests/qemuxml2argvdata/qemuxml2argv-name-escape.args index a5e35b8..ffec3f4 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-name-escape.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-name-escape.args @@ -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 diff --git a/tests/qemuxml2argvdata/qemuxml2argv-name-escape.xml b/tests/qemuxml2argvdata/qemuxml2argv-name-escape.xml index 3a8c3cd..e263553 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-name-escape.xml +++ b/tests/qemuxml2argvdata/qemuxml2argv-name-escape.xml @@ -14,5 +14,6 @@ destroy /usr/bin/qemu + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index d8834cb..5d15dfd 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -1894,7 +1894,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);