From nobody Wed Dec 17 08:53:06 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 1739357119780606.2033621792225; Wed, 12 Feb 2025 02:45:19 -0800 (PST) Received: by lists.libvirt.org (Postfix, from userid 996) id E50D01B9D; Wed, 12 Feb 2025 05:45:18 -0500 (EST) Received: from lists.libvirt.org (localhost [IPv6:::1]) by lists.libvirt.org (Postfix) with ESMTP id B867B1DF0; Wed, 12 Feb 2025 05:36:57 -0500 (EST) Received: by lists.libvirt.org (Postfix, from userid 996) id 787441E25; Wed, 12 Feb 2025 05:36:52 -0500 (EST) Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) (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 ABE371DD1 for ; Wed, 12 Feb 2025 05:36:24 -0500 (EST) Received: by mail-pj1-f50.google.com with SMTP id 98e67ed59e1d1-2f44353649aso9751625a91.0 for ; Wed, 12 Feb 2025 02:36:24 -0800 (PST) Received: from localhost.localdomain ([117.251.37.46]) by smtp.googlemail.com with ESMTPSA id 98e67ed59e1d1-2fbf98b3277sm1147688a91.7.2025.02.12.02.36.20 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 12 Feb 2025 02:36:22 -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=1739356583; x=1739961383; 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=d3oOFBL+Y+OLtnzTZKBNxEaG1dHlOcGIC6q7GjZNvqM=; b=EVafQlfdMt3OZs4Bxq0UqVyINXp8RToSnJiJrmTjvECXtGvvYdq7myFqpicVJ8VZWL j6wuNdZyloEspCKLGehGp0sMbFfxq+if8VaSwyE2KH4CzkRiONIA3Pb9NaBer322JLdf VJYJ0dm83KEO07uSYv2JEN8zA/TXS9ODHHWWagsmHtlhPsYfD5RXchbMfuA4iYxSdAtY lCgndj82kTBGadlv+H59l+2RavmxmHFov8IYxz4IMj9X3GcTs7E+v1IXluoKRGOhaW4p 27C+8VHv1zlWCetzlvDpVLqePUQAAUGESnZ7oDRnKlaV/axNFWLiM+5EgZMdLEeFtBVQ IFOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1739356583; x=1739961383; 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=d3oOFBL+Y+OLtnzTZKBNxEaG1dHlOcGIC6q7GjZNvqM=; b=SFoCFzQMqUbkS+kq7AIvElYnXCxrF2Tej19RmhoXtK6AYjjBNt4819RmIFJpmzrLh6 qVyG1HvDXaPuHYY3X6MEmGCLIrTKKfgoJc7h99eQczhq1bzdrXVbNMCeH56oZpZwwDjR cqv3ei5kOp7p6jeGpBK7+tOoFw+kr9GfOubZyTmtlPk9QMVZ54EdnxVKXCyHRHXJidDm FI+mRRzPAykkx0giR/qku+m+tVkR2h3bXXZhp36YuTaWNyDv3b753WoCWOClEprQ94XG QPphUBC0dIHvUMP14XmcK2XILigEloSkuSY5FuaYg0He2jTMOXU/pHtH8sAMQJec8j4A kJOQ== X-Gm-Message-State: AOJu0Yw/05Q/MK+X7H5pqT/CaAUFhkQR58y0VWb3UReXiuPCksoQ1rs8 eB8CAxdACL0JYLTpjkbdKxmb2v9ibaSdnnloyAGXMfNHwT+u2gW/qK3TFA== X-Gm-Gg: ASbGncvFSrkqfx8jI+p5NwQ4PsOWXjc4ycTysk9r9vi3gvg2+sT4NFY0OesYtou6bT3 v8M8HAIkljxclXz9sc9E+HRcgVLtmq+wMv1t74FMSjYUl0woOhXWWAI6HH3u3u28iBetR/8BaHU FLzhOwIp8uKRv26QUMCf3N9/ZpSuwOINpChrJR+Cn06UgGtCWbbHM0bL3FGvl386VJOiLHxeHCp lnA/EROsk7SKyGyLXxIQmtNycr72ubVyf/JIV2R9gJK8Aw1FeH42NC08319nqNLBvPO78ebmlVi 1HD17dygeTShCMXEck34ZcCcAOISeoUXs6Sbq1d8Ed+zjQ== X-Google-Smtp-Source: AGHT+IFi1IDu9a7SgKV/7aEMl6Mbb+oH/L0a8ylVap+fRiZFctpyekNUJcQ66aAKm6L62m6qef7Z9Q== X-Received: by 2002:a17:90b:4b06:b0:2ee:f687:6ad5 with SMTP id 98e67ed59e1d1-2fbf8957f05mr3468319a91.2.1739356582735; Wed, 12 Feb 2025 02:36:22 -0800 (PST) From: Harikumar Rajkumar To: devel@lists.libvirt.org Subject: [PATCH v7 13/18] qemuxmlconftest: Add 'throttlefilter' tests Date: Wed, 12 Feb 2025 16:05:32 +0530 Message-Id: <20250212103537.26352-14-harirajkumar230@gmail.com> X-Mailer: git-send-email 2.39.5 (Apple Git-154) In-Reply-To: <20250212103537.26352-1-harirajkumar230@gmail.com> References: <20250212103537.26352-1-harirajkumar230@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-ID-Hash: BIWDHEM3U64E7GSAMQOYR7NESPEMYLKK X-Message-ID-Hash: BIWDHEM3U64E7GSAMQOYR7NESPEMYLKK 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: harikumar.rajkumar@ibm.com, sanjeev.ranjan@ibm.com, earulana@in.ibm.com, 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: 1739357125690019000 Content-Type: text/plain; charset="utf-8" * 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: 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 + +
+ + +
+ + +
+ + + + +