From patchwork Sun May 8 18:43:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 67325 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp1260889qge; Sun, 8 May 2016 11:46:39 -0700 (PDT) X-Received: by 10.28.165.209 with SMTP id o200mr7078226wme.61.1462733199785; Sun, 08 May 2016 11:46:39 -0700 (PDT) Return-Path: Received: from mx5-phx2.redhat.com (mx5-phx2.redhat.com. [209.132.183.37]) by mx.google.com with ESMTPS id r64si21936204wme.10.2016.05.08.11.46.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 May 2016 11:46:39 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.37 as permitted sender) client-ip=209.132.183.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.37 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 mx5-phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u48IhmhA005178; Sun, 8 May 2016 14:43:49 -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 u48IhlRV016835 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 u48IhhIZ024246; Sun, 8 May 2016 14:43:47 -0400 From: Cole Robinson To: libvirt-list@redhat.com Date: Sun, 8 May 2016 14:43:40 -0400 Message-Id: <73e296d2362b57f2c0857189cbfc975bc2d04ed5.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 5/6] qemu: command: escape commas in chardev 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 After this, a default virt-manager VM will startup with a comma in the VM name: https://bugzilla.redhat.com/show_bug.cgi?id=639926 --- src/qemu/qemu_command.c | 9 ++++----- tests/qemuxml2argvdata/qemuxml2argv-name-escape.args | 2 +- 2 files changed, 5 insertions(+), 6 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 22fb51c..6b89508 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4914,11 +4914,10 @@ qemuBuildChrChardevStr(virLogManagerPtr logManager, break; case VIR_DOMAIN_CHR_TYPE_UNIX: - virBufferAsprintf(&buf, - "socket,id=char%s,path=%s%s", - alias, - dev->data.nix.path, - dev->data.nix.listen ? ",server,nowait" : ""); + virBufferAsprintf(&buf, "socket,id=char%s,path=", alias); + qemuBufferEscapeComma(&buf, dev->data.nix.path); + if (dev->data.nix.listen) + virBufferAddLit(&buf, ",server,nowait"); break; case VIR_DOMAIN_CHR_TYPE_SPICEVMC: diff --git a/tests/qemuxml2argvdata/qemuxml2argv-name-escape.args b/tests/qemuxml2argvdata/qemuxml2argv-name-escape.args index ffec3f4..b50b8c4 100644 --- a/tests/qemuxml2argvdata/qemuxml2argv-name-escape.args +++ b/tests/qemuxml2argvdata/qemuxml2argv-name-escape.args @@ -14,7 +14,7 @@ bar/master-key.aes \ -smp 1 \ -uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ -nodefaults \ --chardev socket,id=charmonitor,path=/tmp/lib/domain--1-foo,bar/monitor.sock,\ +-chardev socket,id=charmonitor,path=/tmp/lib/domain--1-foo,,bar/monitor.sock,\ server,nowait \ -mon chardev=charmonitor,id=monitor,mode=readline \ -no-acpi \