From nobody Thu Jul 3 17:30:12 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 1529344676903484.50070769985996; Mon, 18 Jun 2018 10:57:56 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 819531279B; Mon, 18 Jun 2018 17:57:55 +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 4E8A85C257; 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 0241C4A46E; Mon, 18 Jun 2018 17:57:55 +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 w5IHvda8027839 for ; Mon, 18 Jun 2018 13:57:39 -0400 Received: by smtp.corp.redhat.com (Postfix) id 0B748111CD5C; 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 E5417111DCE8; Mon, 18 Jun 2018 17:57:38 +0000 (UTC) From: Anya Harter To: libvir-list@redhat.com Date: Mon, 18 Jun 2018 13:57:24 -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 2/4] qemu: Escape commas for qemuBuildChrChardevFileStr 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.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); 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 fileval. Signed-off-by: Anya Harter Reviewed-by: John Ferlan --- src/qemu/qemu_command.c | 3 ++- tests/qemuxml2argvdata/name-escape.args | 2 ++ tests/qemuxml2argvdata/name-escape.xml | 4 ++++ tests/qemuxml2argvtest.c | 3 ++- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index b764008949..40e8f8fccf 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -4867,7 +4867,8 @@ qemuBuildChrChardevFileStr(virLogManagerPtr logManage= r, virBufferAsprintf(buf, ",%s=3D%s,%s=3Don", filearg, fdpath, append= arg); VIR_FREE(fdpath); } else { - virBufferAsprintf(buf, ",%s=3D%s", filearg, fileval); + virBufferAsprintf(buf, ",%s=3D", filearg); + virQEMUBuildBufferEscapeComma(buf, fileval); if (appendval !=3D VIR_TRISTATE_SWITCH_ABSENT) { virBufferAsprintf(buf, ",%s=3D%s", appendarg, virTristateSwitchTypeToString(appendval)); diff --git a/tests/qemuxml2argvdata/name-escape.args b/tests/qemuxml2argvda= ta/name-escape.args index 4b03068f95..35a13b2533 100644 --- a/tests/qemuxml2argvdata/name-escape.args +++ b/tests/qemuxml2argvdata/name-escape.args @@ -25,6 +25,8 @@ bar=3D2/monitor.sock,server,nowait \ -usb \ -chardev tty,id=3Dcharserial0,path=3D/dev/ttyS2,,foo \ -device isa-serial,chardev=3Dcharserial0,id=3Dserial0 \ +-chardev file,id=3Dcharserial1,path=3D/tmp/serial.log,,foo,append=3Don \ +-device isa-serial,chardev=3Dcharserial1,id=3Dserial1 \ -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 \ diff --git a/tests/qemuxml2argvdata/name-escape.xml b/tests/qemuxml2argvdat= a/name-escape.xml index 3f5e1c9829..79c1b34458 100644 --- a/tests/qemuxml2argvdata/name-escape.xml +++ b/tests/qemuxml2argvdata/name-escape.xml @@ -23,6 +23,10 @@ + + + + diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index c194ff59c9..3e02fa576c 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2761,7 +2761,8 @@ mymain(void) QEMU_CAPS_DEVICE_CIRRUS_VGA, QEMU_CAPS_SPICE, QEMU_CAPS_SPICE_UNIX, - QEMU_CAPS_DEVICE_ISA_SERIAL); + QEMU_CAPS_DEVICE_ISA_SERIAL, + QEMU_CAPS_CHARDEV_FILE_APPEND); DO_TEST("debug-threads", QEMU_CAPS_NAME_DEBUG_THREADS); =20 DO_TEST("master-key", QEMU_CAPS_OBJECT_SECRET); --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list