From nobody Sat Apr 27 20:01:26 2024 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 1529425291925921.8096919813763; Tue, 19 Jun 2018 09:21:31 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0A31B3082A2A; Tue, 19 Jun 2018 16:21:30 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EE2C85D9C5; Tue, 19 Jun 2018 16:21:28 +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 1B4551800538; Tue, 19 Jun 2018 16:21:27 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w5JGLOG0009004 for ; Tue, 19 Jun 2018 12:21:24 -0400 Received: by smtp.corp.redhat.com (Postfix) id 2202E200AC25; Tue, 19 Jun 2018 16:21:24 +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 04032200AC23; Tue, 19 Jun 2018 16:21:23 +0000 (UTC) From: Anya Harter To: libvir-list@redhat.com Date: Tue, 19 Jun 2018 12:20:18 -0400 Message-Id: <3cdc731fa1aa7a9c7877fe658855d330b7def5c5.1529425041.git.aharter@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-loop: libvir-list@redhat.com Cc: Anya Harter Subject: [libvirt] [PATCH] qemu: Escape commas for qemuBuildDiskThrottling 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.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.45]); Tue, 19 Jun 2018 16:21:30 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Add comma escaping for disk->blkdeviotune.group_name. Signed-off-by: Anya Harter Reviewed-by: John Ferlan --- src/qemu/qemu_command.c | 4 ++-- tests/qemuxml2argvdata/name-escape.args | 5 +++++ tests/qemuxml2argvdata/name-escape.xml | 13 +++++++++++++ tests/qemuxml2argvtest.c | 2 ++ 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 20c6ac2a04..e05b106a5e 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -1554,8 +1554,8 @@ qemuBuildDiskThrottling(virDomainDiskDefPtr disk, =20 IOTUNE_ADD(size_iops_sec, "iops-size"); if (disk->blkdeviotune.group_name) { - virBufferEscapeString(buf, ",throttling.group=3D%s", - disk->blkdeviotune.group_name); + virBufferAddLit(buf, ",throttling.group=3D"); + virQEMUBuildBufferEscapeComma(buf, disk->blkdeviotune.group_name); } =20 IOTUNE_ADD(total_bytes_sec_max_length, "bps-total-max-length"); diff --git a/tests/qemuxml2argvdata/name-escape.args b/tests/qemuxml2argvda= ta/name-escape.args index 72ed2e8410..aef7c238ca 100644 --- a/tests/qemuxml2argvdata/name-escape.args +++ b/tests/qemuxml2argvdata/name-escape.args @@ -24,6 +24,11 @@ bar=3D2/monitor.sock,server,nowait \ -boot c \ -device usb-ccid,id=3Dccid0,bus=3Dusb.0,port=3D1 \ -usb \ +-drive file=3D/dev/HostVG/QEMUGuest1,format=3Dqcow2,if=3Dnone,id=3Ddrive-i= de0-0-0,\ +cache=3Dnone,throttling.bps-total=3D5000,throttling.iops-total=3D6000,\ +throttling.bps-total-max=3D10000,throttling.iops-total-max=3D11000,\ +throttling.group=3Dlibvirt_iotune_group1,,foo \ +-device ide-drive,bus=3Dide.0,unit=3D0,drive=3Ddrive-ide0-0-0,id=3Dide0-0-= 0 \ -device ccid-card-emulated,backend=3Dcertificates,cert1=3Dcert1,,foo,cert2= =3Dcert2,\ cert3=3Dcert3,db=3D/etc/pki/nssdb,,foo,id=3Dsmartcard0,bus=3Dccid0.0 \ -chardev tty,id=3Dcharserial0,path=3D/dev/ttyS2,,foo \ diff --git a/tests/qemuxml2argvdata/name-escape.xml b/tests/qemuxml2argvdat= a/name-escape.xml index 0580de1813..70a1ce09d3 100644 --- a/tests/qemuxml2argvdata/name-escape.xml +++ b/tests/qemuxml2argvdata/name-escape.xml @@ -14,6 +14,19 @@ destroy /usr/bin/qemu-system-i686 + + + + + + 5000 + 6000 + 10000 + 11000 + libvirt_iotune_group1,foo + +
+ diff --git a/tests/qemuxml2argvtest.c b/tests/qemuxml2argvtest.c index a9a493e308..582a9de7bb 100644 --- a/tests/qemuxml2argvtest.c +++ b/tests/qemuxml2argvtest.c @@ -2758,6 +2758,8 @@ mymain(void) DO_TEST("name-escape", QEMU_CAPS_NAME_DEBUG_THREADS, QEMU_CAPS_OBJECT_SECRET, + QEMU_CAPS_DRIVE_IOTUNE_MAX, + QEMU_CAPS_DRIVE_IOTUNE_GROUP, QEMU_CAPS_VNC, QEMU_CAPS_NAME_GUEST, QEMU_CAPS_DEVICE_CIRRUS_VGA, --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list