From nobody Fri Dec 19 18:47:40 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) client-ip=8.43.85.245; envelope-from=devel-bounces@lists.libvirt.org; helo=lists.libvirt.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass(p=reject dis=none) header.from=lists.libvirt.org ARC-Seal: i=1; a=rsa-sha256; t=1742319823; cv=none; d=zohomail.com; s=zohoarc; b=Atrvt3HcbuZL7qXl2OZN2YeHiogd/A4k7Z0MjMqU1aW0FQCg3N9nh6qLwNjw6O75m30rYrCsJCIt0I6sWS0NpkLaWYjnlkAZuT5Ll7M9SnD4qO1BpKJpJG7nk+EOvU4UV8NR5di4vqsbM072Hzbz2x9czRSS74uQkcWWVl/hXW0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1742319823; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Subject:Subject:To:To:Message-Id; bh=ySWPndyfzvSnAa/mPRXuQ6piAFEiqVWsexfHYh3ZEqU=; b=k/Dl5h6VaBsaO2npfDmFpdc+ErheADnjjLS43FxGaxDCNClfrnBJy1+R4hlS4PEUEM3PAj8N7YtKNdRcN9nCMqcRE3Pi8VciIFbR1fEpmeVDWFcX3n/rwYHuxyv/oVxhx0oLnQAEYViM2iFCym6+XvnwRoUujpV+ActoQ94G/9k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.libvirt.org designates 8.43.85.245 as permitted sender) smtp.mailfrom=devel-bounces@lists.libvirt.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1742319823324396.9382455897967; Tue, 18 Mar 2025 10:43:43 -0700 (PDT) Received: by lists.libvirt.org (Postfix, from userid 996) id 5770F15FA; Tue, 18 Mar 2025 13:43:42 -0400 (EDT) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id 639D617D4; Tue, 18 Mar 2025 13:35:33 -0400 (EDT) Received: by lists.libvirt.org (Postfix, from userid 996) id BF65C166A; Tue, 18 Mar 2025 13:35:21 -0400 (EDT) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.libvirt.org (Postfix) with ESMTPS id 60086174F for ; Tue, 18 Mar 2025 13:35:01 -0400 (EDT) Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-297-EkHEJNzHOsGrTg1VJ4iXDA-1; Tue, 18 Mar 2025 13:34:59 -0400 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D7A1119560B4; Tue, 18 Mar 2025 17:34:58 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.45.242.6]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 7C99F3001D0E; Tue, 18 Mar 2025 17:34:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on lists.libvirt.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL,RCVD_IN_VALIDITY_RPBL_BLOCKED, RCVD_IN_VALIDITY_SAFE_BLOCKED,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1742319301; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=H+yxvCZ7Fv0zC8bmEaAZogkvDeOtYgpr4aQdm7xnGs0=; b=DUwFQVmSMweWlygQgi3CIVF3Vnv9E3VE2nQiaGjSgzXoORN+BQ/xb/SHPK5RQ3q56GnREb g+6vGTzw+ZrT70Stiq9iJI+jWHPJROTj/yyq2mYPv/m/jcLJzFNH4/681EpCc/0tQWVzkI keyw5kfS8w0IOXiKqEJrlZKVWxKjmNE= X-MC-Unique: EkHEJNzHOsGrTg1VJ4iXDA-1 X-Mimecast-MFC-AGG-ID: EkHEJNzHOsGrTg1VJ4iXDA_1742319299 To: devel@lists.libvirt.org Subject: [PATCH v9 13/17] qemuxmlconftest: Add 'throttlefilter' tests Date: Tue, 18 Mar 2025 18:34:27 +0100 Message-ID: <00e81ed054480ce0da0407d52f013bd44c22b2a1.1742318898.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: DoyD2HNjRVMSs17ScrA1oUU8q6wlencRFKu12p_9e0g_1742319299 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Message-ID-Hash: YWVGY6ZF6ARFQM26HWL77QPNJPLBCBDE X-Message-ID-Hash: YWVGY6ZF6ARFQM26HWL77QPNJPLBCBDE X-MailFrom: pkrempa@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-config-2; header-match-config-3; header-match-devel.lists.libvirt.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header CC: Harikumar Rajkumar , harikumar.rajkumar@ibm.com X-Mailman-Version: 3.2.2 Precedence: list List-Id: Development discussions about the libvirt library & tools Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: From: Peter Krempa via Devel Reply-To: Peter Krempa X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1742319826880019100 Content-Type: text/plain; charset="utf-8" From: Chun Feng Wu * Add tests for throttlegroup domain xml processing, including groups referenced and not referenced by filters * Add tests for throttlefilter domain xml processing, including throttle group referenced by different disks * Add negative test case to report error when iotune is configured together with throttle filters Signed-off-by: Chun Feng Wu * Isolate domain xml test Signed-off-by: Harikumar Rajkumar * Added test case with copy on read Reviewed-by-by: Peter Krempa Signed-off-by: Peter Krempa --- .../throttlefilter-invalid.x86_64-latest.err | 1 + .../throttlefilter-invalid.xml | 89 +++++++++++++++ .../throttlefilter.x86_64-latest.args | 56 ++++++++++ .../throttlefilter.x86_64-latest.xml | 105 ++++++++++++++++++ tests/qemuxmlconfdata/throttlefilter.xml | 95 ++++++++++++++++ tests/qemuxmlconftest.c | 2 + 6 files changed, 348 insertions(+) create mode 100644 tests/qemuxmlconfdata/throttlefilter-invalid.x86_64-lat= est.err create mode 100644 tests/qemuxmlconfdata/throttlefilter-invalid.xml create mode 100644 tests/qemuxmlconfdata/throttlefilter.x86_64-latest.args create mode 100644 tests/qemuxmlconfdata/throttlefilter.x86_64-latest.xml create mode 100644 tests/qemuxmlconfdata/throttlefilter.xml diff --git a/tests/qemuxmlconfdata/throttlefilter-invalid.x86_64-latest.err= b/tests/qemuxmlconfdata/throttlefilter-invalid.x86_64-latest.err new file mode 100644 index 0000000000..ddb9670617 --- /dev/null +++ b/tests/qemuxmlconfdata/throttlefilter-invalid.x86_64-latest.err @@ -0,0 +1 @@ +Operation not supported: block 'throttlefilters' can't be used together wi= th 'iotune' for disk 'vda' diff --git a/tests/qemuxmlconfdata/throttlefilter-invalid.xml b/tests/qemux= mlconfdata/throttlefilter-invalid.xml new file mode 100644 index 0000000000..ebd250acac --- /dev/null +++ b/tests/qemuxmlconfdata/throttlefilter-invalid.xml @@ -0,0 +1,89 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + + 4000 + 4000 + limit0 + + + 5000 + 5000 + 5000 + limit1 + + + 6000 + 6000 + 6000 + limit2 + + + 7000 + 7000 + 7000 + limit12 + + + 7000 + 7000 + 7000 + limit3 + + + + hvm + + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + + + 10000000 + 400000 + 100000 + + + + +
+ + + + + + + + + +
+ + + + + + + + + +
+ + + + + + + + + diff --git a/tests/qemuxmlconfdata/throttlefilter.x86_64-latest.args b/test= s/qemuxmlconfdata/throttlefilter.x86_64-latest.args new file mode 100644 index 0000000000..6a37f5835a --- /dev/null +++ b/tests/qemuxmlconfdata/throttlefilter.x86_64-latest.args @@ -0,0 +1,56 @@ +LC_ALL=3DC \ +PATH=3D/bin \ +HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1 \ +USER=3Dtest \ +LOGNAME=3Dtest \ +XDG_DATA_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.local/share \ +XDG_CACHE_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.cache \ +XDG_CONFIG_HOME=3D/var/lib/libvirt/qemu/domain--1-QEMUGuest1/.config \ +/usr/bin/qemu-system-x86_64 \ +-name guest=3DQEMUGuest1,debug-threads=3Don \ +-S \ +-object '{"qom-type":"secret","id":"masterKey0","format":"raw","file":"/va= r/lib/libvirt/qemu/domain--1-QEMUGuest1/master-key.aes"}' \ +-machine pc,usb=3Doff,dump-guest-core=3Doff,memory-backend=3Dpc.ram,acpi= =3Doff \ +-accel tcg \ +-cpu qemu64 \ +-m size=3D219136k \ +-object '{"qom-type":"memory-backend-ram","id":"pc.ram","size":224395264}'= \ +-overcommit mem-lock=3Doff \ +-smp 1,sockets=3D1,cores=3D1,threads=3D1 \ +-object '{"qom-type":"throttle-group","id":"throttle-limit0","limits":{"bp= s-total":4000,"bps-read":0,"bps-write":0,"iops-total":4000,"iops-read":0,"i= ops-write":0,"bps-total-max":0,"bps-read-max":0,"bps-write-max":0,"iops-tot= al-max":0,"iops-read-max":0,"iops-write-max":0,"iops-size":0}}' \ +-object '{"qom-type":"throttle-group","id":"throttle-limit1","limits":{"bp= s-total":0,"bps-read":5000,"bps-write":5000,"iops-total":5000,"iops-read":0= ,"iops-write":0,"bps-total-max":0,"bps-read-max":0,"bps-write-max":0,"iops-= total-max":0,"iops-read-max":0,"iops-write-max":0,"iops-size":0}}' \ +-object '{"qom-type":"throttle-group","id":"throttle-limit2","limits":{"bp= s-total":0,"bps-read":6000,"bps-write":6000,"iops-total":6000,"iops-read":0= ,"iops-write":0,"bps-total-max":0,"bps-read-max":0,"bps-write-max":0,"iops-= total-max":0,"iops-read-max":0,"iops-write-max":0,"iops-size":0}}' \ +-object '{"qom-type":"throttle-group","id":"throttle-limit12","limits":{"b= ps-total":0,"bps-read":7000,"bps-write":7000,"iops-total":7000,"iops-read":= 0,"iops-write":0,"bps-total-max":0,"bps-read-max":0,"bps-write-max":0,"iops= -total-max":0,"iops-read-max":0,"iops-write-max":0,"iops-size":0}}' \ +-object '{"qom-type":"throttle-group","id":"throttle-limit3","limits":{"bp= s-total":0,"bps-read":8000,"bps-write":8000,"iops-total":8000,"iops-read":0= ,"iops-write":0,"bps-total-max":0,"bps-read-max":0,"bps-write-max":0,"iops-= total-max":0,"iops-read-max":0,"iops-write-max":0,"iops-size":0}}' \ +-uuid c7a5fdbd-edaf-9455-926a-d65c16db1809 \ +-display none \ +-no-user-config \ +-nodefaults \ +-chardev socket,id=3Dcharmonitor,fd=3D1729,server=3Don,wait=3Doff \ +-mon chardev=3Dcharmonitor,id=3Dmonitor,mode=3Dcontrol \ +-rtc base=3Dutc \ +-no-shutdown \ +-boot strict=3Don \ +-device '{"driver":"piix3-usb-uhci","id":"usb","bus":"pci.0","addr":"0x1.0= x2"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest1","no= de-name":"libvirt-8-storage","auto-read-only":true,"discard":"unmap","cache= ":{"direct":true,"no-flush":false}}' \ +-blockdev '{"node-name":"libvirt-8-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-8-storage"}' \ +-blockdev '{"driver":"throttle","node-name":"libvirt-9-filter","throttle-g= roup":"throttle-limit0","file":"libvirt-8-format"}' \ +-device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x4","drive":"li= bvirt-9-filter","id":"virtio-disk0","bootindex":1,"write-cache":"on"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest2","no= de-name":"libvirt-5-storage","auto-read-only":true,"discard":"unmap","cache= ":{"direct":true,"no-flush":false}}' \ +-blockdev '{"node-name":"libvirt-5-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-5-storage"}' \ +-blockdev '{"driver":"throttle","node-name":"libvirt-6-filter","throttle-g= roup":"throttle-limit1","file":"libvirt-5-format"}' \ +-blockdev '{"driver":"throttle","node-name":"libvirt-7-filter","throttle-g= roup":"throttle-limit12","file":"libvirt-6-filter"}' \ +-device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x5","drive":"li= bvirt-7-filter","id":"virtio-disk1","write-cache":"on"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest3","no= de-name":"libvirt-2-storage","auto-read-only":true,"discard":"unmap","cache= ":{"direct":true,"no-flush":false}}' \ +-blockdev '{"node-name":"libvirt-2-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-2-storage"}' \ +-blockdev '{"driver":"copy-on-read","node-name":"libvirt-CoR-vdc","file":"= libvirt-2-format","discard":"unmap"}' \ +-blockdev '{"driver":"throttle","node-name":"libvirt-3-filter","throttle-g= roup":"throttle-limit2","file":"libvirt-CoR-vdc"}' \ +-blockdev '{"driver":"throttle","node-name":"libvirt-4-filter","throttle-g= roup":"throttle-limit12","file":"libvirt-3-filter"}' \ +-device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x6","drive":"li= bvirt-4-filter","id":"virtio-disk2","write-cache":"on"}' \ +-blockdev '{"driver":"host_device","filename":"/dev/HostVG/QEMUGuest4","no= de-name":"libvirt-1-storage","auto-read-only":true,"discard":"unmap","cache= ":{"direct":true,"no-flush":false}}' \ +-blockdev '{"node-name":"libvirt-1-format","read-only":false,"cache":{"dir= ect":true,"no-flush":false},"driver":"qcow2","file":"libvirt-1-storage"}' \ +-device '{"driver":"virtio-blk-pci","bus":"pci.0","addr":"0x7","drive":"li= bvirt-1-format","id":"virtio-disk3","write-cache":"on"}' \ +-audiodev '{"id":"audio1","driver":"none"}' \ +-device '{"driver":"virtio-balloon-pci","id":"balloon0","bus":"pci.0","add= r":"0x2"}' \ +-sandbox on,obsolete=3Ddeny,elevateprivileges=3Ddeny,spawn=3Ddeny,resource= control=3Ddeny \ +-msg timestamp=3Don diff --git a/tests/qemuxmlconfdata/throttlefilter.x86_64-latest.xml b/tests= /qemuxmlconfdata/throttlefilter.x86_64-latest.xml new file mode 100644 index 0000000000..89bc0d71b5 --- /dev/null +++ b/tests/qemuxmlconfdata/throttlefilter.x86_64-latest.xml @@ -0,0 +1,105 @@ + + QEMUGuest1 + c7a5fdbd-edaf-9455-926a-d65c16db1809 + 219100 + 219100 + 1 + + + 4000 + 4000 + limit0 + + + 5000 + 5000 + 5000 + limit1 + + + 6000 + 6000 + 6000 + limit2 + + + 7000 + 7000 + 7000 + limit12 + + + 8000 + 8000 + 8000 + limit3 + + + + hvm + + + + qemu64 + + + destroy + restart + destroy + + /usr/bin/qemu-system-x86_64 + + + + + + + +
+ + + + + + + + + +
+ + + + + + + + + +
+ + + + + + + 10000000 + 400000 + 100000 + +
+ + +
+ + +
+ + + + +