[libvirt] [PATCH] Maximum vlanid should be 4095 in interface.rng

Ján Tomko jtomko at redhat.com
Thu Aug 14 13:17:32 UTC 2014


On 08/13/2014 10:10 AM, Jianwei Hu wrote:
> The correct vlanid range is 0~4095.
> 
> After merging this patch, we can not validate a interface xml with vlanid >= 4096.
> [root at localhost ~]# cat vlan.xml
> <interface type='vlan' name='eno1.4096'>
>    <start mode='onboot'/>
>    <protocol family='ipv4'>
>     <dhcp/>
>    </protocol>
>    <vlan tag='4096'>
>      <interface name='eno1'/>
>    </vlan>
> </interface>
> [root at localhost ~]# virt-xml-validate vlan.xml
> vlan.xml:1: element interface: Relax-NG validity error : Invalid sequence in interleave
> vlan.xml:6: element vlan: Relax-NG validity error : Element interface failed to validate content
> vlan.xml:6: element vlan: Relax-NG validity error : Element vlan failed to validate attributes
> vlan.xml fails to validate
> [root at localhost ~]#
> 
> Here is a ip command help on this.
> [root at localhost /]# ip link add link eno1 name eno1.90 type vlan help
> Usage: ... vlan [ protocol VLANPROTO ] id VLANID                [ FLAG-LIST ]
>                 [ ingress-qos-map QOS-MAP ] [ egress-qos-map QOS-MAP ]
> 
> VLANPROTO: [ 802.1Q / 802.1ad ]
> VLANID := 0-4095
> FLAG-LIST := [ FLAG-LIST ] FLAG
> FLAG := [ reorder_hdr { on | off } ] [ gvrp { on | off } ] [ mvrp { on | off } ]
>         [ loose_binding { on | off } ]
> QOS-MAP := [ QOS-MAP ] QOS-MAPPING
> QOS-MAPPING := FROM:TO
> ---
>  docs/schemas/interface.rng | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/docs/schemas/interface.rng b/docs/schemas/interface.rng
> index 80962d4..0f577d6 100644
> --- a/docs/schemas/interface.rng
> +++ b/docs/schemas/interface.rng
> @@ -440,7 +440,7 @@
>  
>    <define name='vlan-id'>
>      <data type="unsignedInt">
> -      <param name="maxInclusive">4096</param>
> +      <param name="maxInclusive">4095</param>
>      </data>
>    </define>
>  </grammar>
> 

ACK and pushed.

Jan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140814/4550e219/attachment-0001.sig>


More information about the libvir-list mailing list