On 04/17/2013 03:00 PM, Ján Tomko wrote:
Add new controller type 'pci' with models 'pci-root'
and 'pci-bridge'.
---
docs/schemas/domaincommon.rng | 3 +++
src/conf/domain_conf.c | 21 ++++++++++++++++++++-
src/conf/domain_conf.h | 9 +++++++++
3 files changed, 32 insertions(+), 1 deletion(-)
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 468c49c..a66a289 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -1413,6 +1413,7 @@
<value>sata</value>
<value>ccid</value>
<value>usb</value>
+ <value>pci</value>
</choice>
</attribute>
</optional>
@@ -1459,6 +1460,8 @@
<value>pci-ohci</value>
<value>nec-xhci</value>
<value>none</value>
+ <value>pci-root</value>
+ <value>pci-bridge</value>
</choice>
</attribute>
It occurred to me that we should only allow model='pci-root|pci-bridge'
if type='pci', and when I went back to look at the rng directly (instead
of just the diff), I noticed that there is already a separate set of
attributes/values allowable for type='virtio-serial'. So, especially
because there is already a precedent, I think there should be a separate
<group> for type='pci', just as there is for type='virtio-serial',
and
it should allow model='pci-root|pci-bridge'. Of course this means that
the other attribute list will have to be moved inside the existing
<group> (and ideally, that group should be split into a separate group
for each type)
I just made a patch that cleans up the controller rng as described above:
http://www.redhat.com/archives/libvir-list/2013-April/msg01320.html
Once it has been applied, you can just make the following change to
domaincommon.rng instead of what you did above:
diff --git a/docs/schemas/domaincommon.rng b/docs/schemas/domaincommon.rng
index 26523a7..e6af27b 100644
--- a/docs/schemas/domaincommon.rng
+++ b/docs/schemas/domaincommon.rng
@@ -1475,6 +1475,18 @@
<ref name="usbmaster"/>
</optional>
</group>
+ <!-- pci has an optional attribute "model" -->
+ <group>
+ <attribute name="type">
+ <value>pci</value>
+ </attribute>
+ <attribute name="model">
+ <choice>
+ <value>pci-root</value>
+ <value>pci-bridge</value>
+ </choice>
+ </attribute>
+ </group>
<!-- virtio-serial has optional "ports" and "vectors"
-->
<group>
<attribute name="type">