schema: Allow counter element in host cpu definition

If the capabilities include a counter element, e.g.
  <counter name='tsc' frequency='2591999000' scaling='no'/>
the XML could not be validated:
  $ virsh capabilities > cap.xml
  $ virsh [hypervisor-]cpu-compare cap.xml --validate
  error: Failed to compare hypervisor CPU with cap.txt
  error: XML document failed to validate against schema: Unable to validate doc against /usr/share/libvirt/schemas/cpu.rng
  Did not expect element counter there

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Tim Wiederhake 2020-12-15 13:16:48 +01:00 committed by Michal Privoznik
parent 07cc8b007f
commit 37ffe24968

View File

@ -336,6 +336,19 @@
</attribute>
</element>
</optional>
<optional>
<element name="counter">
<attribute name="name">
<text/>
</attribute>
<attribute name="frequency">
<ref name="positiveInteger"/>
</attribute>
<attribute name="scaling">
<ref name="virYesNo"/>
</attribute>
</element>
</optional>
<optional>
<ref name="cpuTopology"/>
</optional>