On Tue, 2009-06-30 at 10:57 +0100, Daniel P. Berrange wrote:
instead of
<interface type="vlan" device="eth0" vlan="42"/>
it would be
<interface type="vlan">
<vlan tag="42">
<interface>
<name>eth0</name>
</interface>
</vlan>
</interface>
Sure, I can change it to that. In addition, I want to move the name of
an interface from a nested <name> element to the name attribute of the
interface element across the board. That would make your above snippet
<interface type="vlan">
<vlan tag="42">
<interface name='eth0'/>
</vlan>
</interface>
This matches the nesting structure used for bridges, and bonding, so
making it easier to deal with the XML structure in applications.
eg, if you have an interface XML doc you can reliably extract any
dependant interface names with an Xpath "/interface/*/interface/name",
and not have to special case vlans by checking for an @device attribute
instead of nested 'name' element.
Agreed; of course, the nesting gets a little deeper for a vlan enslaved
in a bridge since you now have three levels of <interface> elements:
<interface type="bridge" name="br0"
startmode="onboot">
<protocol family="ipv4">
<dhcp/>
</protocol>
<bridge stp="off">
<interface type="vlan" name="eth0.42">
<vlan tag="42">
<interface name="eth0"/>
</vlan>
</interface>
</bridge>
</interface>
Looking at this, I'd also prefer pulling out the startmode attribute on
all interface elements into a child element:
<interface type='...' name='...'>
<start mode='onboot'/>
...
</interface>
David