On 24.03.2016 20:25, Laine Stump wrote:
The pcie-switch-downstream-port and pcie-root-port controllers have
only a single slot, numbered 0, and the greate majority of all guest
s/greate/great/
PCI devices are plugged into function 0 of whatever slot they're
using. The parser makes these optional, setting them to 0 when not
specified, and it's logical for the schema to also make them optional.
---
docs/schemas/basictypes.rng | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/docs/schemas/basictypes.rng b/docs/schemas/basictypes.rng
index a83063a..084d403 100644
--- a/docs/schemas/basictypes.rng
+++ b/docs/schemas/basictypes.rng
@@ -75,12 +75,16 @@
<attribute name="bus">
<ref name="pciBus"/>
</attribute>
- <attribute name="slot">
- <ref name="pciSlot"/>
- </attribute>
- <attribute name="function">
- <ref name="pciFunc"/>
- </attribute>
+ <optional>
+ <attribute name="slot">
+ <ref name="pciSlot"/>
+ </attribute>
+ </optional>
+ <optional>
+ <attribute name="function">
+ <ref name="pciFunc"/>
+ </attribute>
+ </optional>
<optional>
<attribute name="multifunction">
<ref name="virOnOff"/>
Well, looking into our PCI address parser, all of the attributes are
optional, even domain and bus. None of my guests have non-zero domain
actually ;-). Your call whether to loosen schema even more or stick with
your approach.
ACK
Michal