[libvirt] [PATCH 0/3] Add proper validation of IP/MAC addresses to network.rng

Laine Stump laine at laine.org
Thu Nov 11 20:41:26 UTC 2010


I needed to add more elements to network.rng, and modify the possible
values for some existing elements, but noticed that there was
currently no validation of IP addresses or MAC addresses. As a first
stpe in my modifications, I'm bringing network.rng's validation/format
more in line with what's in, eg, interface.rng.

I'll be adding the new elements later, in a complete patcheset to add
IPv6 support, but since these patches stand on their own, I figured
I'd get them out of the way first.

The first patch puts the entire definition of network inside a
<grammer>, which seemed like the right thing to do in order to be able
to define refs for ipv4-addr/mac-addr outside the element def itself. I
copied the way that it's done in other libvirt RNG files (not sure why
this one wasn't like that already). Although this changed the nesting
of almost the entire file, I left the indentation of existing lines
as-is so the actual change wouldn't be obscured.

The 2nd patch looks very long and confused, but it actually is just
whitespace changes (as verified by diff -b).

The 3rd patch adds the refs for ipv4-addr & mac-addr, and makes use of
them.

networkschematest continues to succeed after these changes, so it
looks like it's all correct.




More information about the libvir-list mailing list