From nobody Thu Jul 3 18:34:30 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1529344677187422.59665456841697; Mon, 18 Jun 2018 10:57:57 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 181BA30832DF; Mon, 18 Jun 2018 17:57:56 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4D5521001914; Mon, 18 Jun 2018 17:57:55 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id F3D234A46C; Mon, 18 Jun 2018 17:57:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w5IHvdmg027849 for ; Mon, 18 Jun 2018 13:57:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id 56913111AF1A; Mon, 18 Jun 2018 17:57:39 +0000 (UTC) Received: from dhcp-17-130.bos.redhat.com (dhcp-17-130.bos.redhat.com [10.18.17.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3CD37111AF17; Mon, 18 Jun 2018 17:57:39 +0000 (UTC) From: Anya Harter To: libvir-list@redhat.com Date: Mon, 18 Jun 2018 13:57:26 -0400 Message-Id: In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-loop: libvir-list@redhat.com Cc: Anya Harter Subject: [libvirt] [PATCH 4/4] qemu: Escape commas for qemuBuildGrapicsSPICECommandLine 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 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Mon, 18 Jun 2018 17:57:56 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Add comma escaping for cfg->spiceTLSx509certdir and graphics->data.spice.rendernode. Signed-off-by: Anya Harter Reviewed-by: John Ferlan --- src/qemu/qemu_command.c | 11 ++++++++--- tests/qemuxml2argvdata/name-escape.args | 5 +++-- tests/qemuxml2argvdata/name-escape.xml | 1 + tests/qemuxml2argvtest.c | 5 +++++ 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index a9a5e200e9..36dccea9b2 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -7974,8 +7974,11 @@ qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfi= gPtr cfg, !cfg->spicePassword) virBufferAddLit(&opt, "disable-ticketing,"); =20 - if (hasSecure) - virBufferAsprintf(&opt, "x509-dir=3D%s,", cfg->spiceTLSx509certdir= ); + if (hasSecure) { + virBufferAddLit(&opt, "x509-dir=3D"); + virQEMUBuildBufferEscapeComma(&opt, cfg->spiceTLSx509certdir); + virBufferAsprintf(&opt, ","); + } =20 switch (graphics->data.spice.defaultMode) { case VIR_DOMAIN_GRAPHICS_SPICE_CHANNEL_MODE_SECURE: @@ -8082,7 +8085,9 @@ qemuBuildGraphicsSPICECommandLine(virQEMUDriverConfig= Ptr cfg, goto error; } =20 - virBufferAsprintf(&opt, "rendernode=3D%s,", graphics->data.spi= ce.rendernode); + virBufferAddLit(&opt, "rendernode=3D"); + virQEMUBuildBufferEscapeComma(&opt, graphics->data.spice.rende= rnode); + virBufferAsprintf(&opt, ","); } } =20 diff --git a/tests/qemuxml2argvdata/name-escape.args b/tests/qemuxml2argvda= ta/name-escape.args index d3b908a7e6..72ed2e8410 100644 --- a/tests/qemuxml2argvdata/name-escape.args +++ b/tests/qemuxml2argvdata/name-escape.args @@ -33,6 +33,7 @@ cert3=3Dcert3,db=3D/etc/pki/nssdb,,foo,id=3Dsmartcard0,bu= s=3Dccid0.0 \ -chardev pipe,id=3Dcharchannel0,path=3D/tmp/guestfwd,,foo \ -netdev user,guestfwd=3Dtcp:10.0.2.1:4600-chardev:charchannel0,id=3Duser-c= hannel0 \ -vnc unix:/tmp/lib/domain--1-foo=3D1,,bar=3D2/vnc.sock \ --spice unix,addr=3D/tmp/lib/domain--1-foo=3D1,,bar=3D2/spice.sock \ --vga cirrus \ +-spice unix,addr=3D/tmp/lib/domain--1-foo=3D1,,bar=3D2/spice.sock,gl=3Don,\ +rendernode=3D/dev/dri/foo,,bar \ +-device cirrus-vga,id=3Dvideo0,bus=3Dpci.0,addr=3D0x2 \ -device virtio-balloon-pci,id=3Dballoon0,bus=3Dpci.0,addr=3D0x3 diff --git a/tests/qemuxml2argvdata/name-escape.xml b/tests/qemuxml2argvdat= a/name-escape.xml index 9ca7be5968..0580de1813 100644 --- a/tests/qemuxml2argvdata/name-escape.xml +++ b/tests/qemuxml2argvdata/name-escape.xml @@ -19,6 +19,7 @@ + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index 7468537c68..ade21f5a10 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2761,6 +2761,11 @@ mymain(void) QEMU_CAPS_DEVICE_CIRRUS_VGA, QEMU_CAPS_SPICE, QEMU_CAPS_SPICE_UNIX, + QEMU_CAPS_DEVICE_VIRTIO_GPU, + QEMU_CAPS_VIRTIO_GPU_VIRGL, + QEMU_CAPS_SPICE_GL, + QEMU_CAPS_SPICE_RENDERNODE, + QEMU_CAPS_DEVICE_VIDEO_PRIMARY, QEMU_CAPS_DEVICE_ISA_SERIAL, QEMU_CAPS_CHARDEV_FILE_APPEND, QEMU_CAPS_CCID_EMULATED); --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list