From nobody Sun Dec 7 13:32:34 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=fail(p=none dis=none) header.from=gmail.com Return-Path: Received: from lists.libvirt.org (lists.libvirt.org [8.43.85.245]) by mx.zohomail.com with SMTPS id 1739985061325213.73087314849113; Wed, 19 Feb 2025 09:11:01 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id 474AA1BB2; Wed, 19 Feb 2025 12:11:00 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id EEA751DA9; Wed, 19 Feb 2025 12:02:40 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 916A71D19; Wed, 19 Feb 2025 12:02:36 -0500 (EST) Received: from mail-pj1-f51.google.com (mail-pj1-f51.google.com [209.85.216.51]) (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 383D81BE9 for ; Wed, 19 Feb 2025 12:02:11 -0500 (EST) Received: by mail-pj1-f51.google.com with SMTP id 98e67ed59e1d1-2f44353649aso35199a91.0 for ; Wed, 19 Feb 2025 09:02:11 -0800 (PST) Received: from localhost.localdomain ([2001:4490:4ea9:8374:8512:e327:fdaf:a56e]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-220d558fe3asm106651545ad.234.2025.02.19.09.02.07 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 19 Feb 2025 09:02:09 -0800 (PST) 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_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3,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=gmail.com; s=20230601; t=1739984530; x=1740589330; darn=lists.libvirt.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=UBYjUhT4NAwyw81c4wALKSKm3ovPPOGhSwXTOcq6NO8=; b=VpasqtbuWSybIY14p9jE7qktc97ioI1bZAKnLI/uHwMdXVgHqYaIiVYUzNblDSaq9A OwVp4aMSIDxDGiIzfcIUIO8iYV3AYKLK6uaymEoA3dhKar5Jf6DzI3Sqh5eATX0eTE2b b39ZgJL3DOMjYtwSs6mMSJPfONWkEBOzoTrNgscIWGVlWyEw85lPJVJMFGXzFgn5ukS+ ahDrLiNN5WuhKlhWTDHNL24ODJihhm1Nmds4V8Orlr8yaMGB7icLO/LssPrauNRprr7y snY5bY40sA+y/2aAlY5UoVpT4UhbutuW8rW1baDy+bTA2LTkG6ty/EjffZTEuINGxT6H s9iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739984530; x=1740589330; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=UBYjUhT4NAwyw81c4wALKSKm3ovPPOGhSwXTOcq6NO8=; b=k36hTzS9z7pO6TAUQ+DpPcIheKUSxB57RPKjCmPHli6nwU5KA+jt36zGVuxjEv43nw rn8bP88FXdfrAQJdecJlb9KD4gaYOOAg0/Wmx7D64+ScCPFR5W0gL6no6qPuQqCdbUdd Z6E6kd4UkVV2W21hFYU/IjYCH0Dbc1spO8KY72F712DL3dgchqvXvAYYzjgJANjMkIvD 0wmHyBoV3NaHn7uZegWzoX2K3cXgkxhBE/FXaKwYbdydr8TAgT6J4/ZJcJ0GI6wZtPHQ 6MFalwcK1CbSYgxVFxHIpgH0Y35uSGNOzXrjP6CHdHfN6j8NWUlpRwm7xVPAg9j44o/h AvBw== X-Gm-Message-State: AOJu0YwGQ9DQWxphIQbOL1WKS9otRfAi7PWlMQBZ9bIhaVBbOwBcXBEc BmAA3ZK/xwKXu+NGo5Pb73tLtebDOXMsXJX9dxLCCfk+6hKvOE7oJyyQYLHL X-Gm-Gg: ASbGncv0C+y2iMDKZK3QkYr6BC/BpzPquZtdXMjBEb0Og8D9KQBwSBawwlecgPejfdn NmMMw6JUs29g7JzJ/Sa1Cnc/rlVo+fUqWFHIF3/fu2Z/ITEx+AtyRXkfONAt953kPbElR6wSlK+ yWy1PrP9L+P1eTmTuYF4Zxaxy2KajJBtQkX15MEtmTttRCcm0HFiaufp3JMPu65yFlEsZSOAUVM iU1aeXwR7RFU8Rf5LA5B44y9QRpejsUh6SEEhAkFzGpgA5/w1sh0/EQraUNwgFLfQKZCocT5Njs T71U4uQJJ6IQ5zAst9ODg40wmjkLmtvpDMFKmjsFdh96x35wwCUCNwZKuw== X-Google-Smtp-Source: AGHT+IGxCgRq5PDcgFxMAamHMgntDBy0ypwcY1xWcSuDg03IfC55NiQcYK+OcNxeqRZMF64Z7v2IHQ== X-Received: by 2002:a17:90b:3c92:b0:2ee:bc7b:9237 with SMTP id 98e67ed59e1d1-2fc41045387mr26484889a91.27.1739984529641; Wed, 19 Feb 2025 09:02:09 -0800 (PST) From: Harikumar Rajkumar To: devel@lists.libvirt.org Subject: [PATCH v8 13/18] qemuxmlconftest: Add 'throttlefilter' tests Date: Wed, 19 Feb 2025 22:27:17 +0530 Message-Id: <20250219165722.26348-14-harirajkumar230@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250219165722.26348-1-harirajkumar230@gmail.com> References: <20250219165722.26348-1-harirajkumar230@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: JTUXZMQEZFUPK7WLWIJGE3XRJTSKU7KL X-Message-ID-Hash: JTUXZMQEZFUPK7WLWIJGE3XRJTSKU7KL X-MailFrom: harirajkumar230@gmail.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: sanjeev.ranjan@ibm.com, harikumar.rajkumar@ibm.com, earulana@in.ibm.com, Chun Feng Wu , Harikumar Rajkumar 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: X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZM-MESSAGEID: 1739985062963019100 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 --- .../throttlefilter-invalid.x86_64-latest.err | 1 + .../throttlefilter-invalid.xml | 89 +++++++++++++++ .../throttlefilter.x86_64-latest.args | 55 +++++++++ .../throttlefilter.x86_64-latest.xml | 105 ++++++++++++++++++ tests/qemuxmlconfdata/throttlefilter.xml | 95 ++++++++++++++++ tests/qemuxmlconftest.c | 2 + 6 files changed, 347 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..4012e7740f --- /dev/null +++ b/tests/qemuxmlconfdata/throttlefilter.x86_64-latest.args @@ -0,0 +1,55 @@ +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":"throttle","node-name":"libvirt-3-filter","throttle-g= roup":"throttle-limit2","file":"libvirt-2-format"}' \ +-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..32d57f1723 --- /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 + +
+ + +
+ + +
+ + + + +