On 7/29/2026 8:52 AM, Peter Krempa wrote:
On Wed, Jul 22, 2026 at 13:52:10 -0500, Jaehoon Kim wrote:
Add support for the iothread poll-weight XML attribute.
Store the value in the internal iothread definition, parse it from
the <poll/> element, and format it back into domain XML. Also extend
the schema to accept the new attribute and validate the accepted
range of [0, 63].
Signed-off-by: Jaehoon Kim <[email protected]>
---
src/conf/domain_conf.c | 14 +++++++++++++-
src/conf/domain_conf.h | 2 ++
src/conf/schemas/domaincommon.rng | 7 +++++++
tests/genericxml2xmlindata/iothreadids.xml | 2 +-
4 files changed, 23 insertions(+), 2 deletions(-)
[...]
diff --git a/src/conf/schemas/domaincommon.rng
b/src/conf/schemas/domaincommon.rng
index 121e4e06a6..36743f81e4 100644
--- a/src/conf/schemas/domaincommon.rng
+++ b/src/conf/schemas/domaincommon.rng
@@ -990,6 +990,13 @@
<ref name="unsignedLong"/>
</attribute>
</optional>
+ <optional>
+ <attribute name="weight">
+ <data type="unsignedInt">
+ <param name="maxInclusive">63</param>
Defining the range in the XML schema is not sufficient as validation is
not mandatory.
You'll need to add an explicit validation check in the code (e.g. in
virDomainDefValidateIOThreads) to actually enforce this.
And at that point I'd maybe suggest removing the XML check, the RNG
validator from libxml2 tends to have rather poor error messages.
Thanks for the feedback. I'll make the following changes in v2.
1.Add an explicit range check for poll-weight in
virDomainDefValidateIOThreads in src/conf/domain_validate.c.
2.Simplify the RNG schema by replacing the maxInclusive constraint,
since the range will be enforced during validation.
Thanks,
Jaehoon