[libvirt] [PATCH 1/2] Trivial fix: in dhcp-host the name is optional

Eric Blake eblake at redhat.com
Tue Feb 19 21:39:41 UTC 2013


On 02/15/2013 12:02 PM, Gene Czarcinski wrote:
> Although in IPv4 one must pick either mac or name, either
> can be omitted.  Similarly, for IPv6, the name
> can be optionally omitted.
> Signed-off-by: Gene Czarcinski <gene at czarc.net>
> ---
>  docs/schemas/network.rng | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/docs/schemas/network.rng b/docs/schemas/network.rng
> index 09d7c73..a479453 100644
> --- a/docs/schemas/network.rng
> +++ b/docs/schemas/network.rng
> @@ -281,7 +281,9 @@
>                      <optional>
>                        <attribute name="mac"><ref name="uniMacAddr"/></attribute>
>                      </optional>
> -                    <attribute name="name"><text/></attribute>
> +                    <optional>
> +                      <attribute name="name"><text/></attribute>
> +                    </optional>

Hmm.  This says that I can omit both name and mac, and still validate.
Better would be this RelaxNG construct, which says that I must supply at
least one, but can also supply both; the difference is that failure to
supply either will cause a (desired) validation failure.

<choice>
  <group>
    <attribute name="mac"><ref name="uniMacAddr"/></attribute>
    <optional>
      <attribute name="name"><text/></attribute>
    </optional>
  </group>
  <attribute name="name"><text/></attribute>
</choice>

I know Laine already ack'd but since we haven't pushed yet, I'm
wondering if it is worth tightening the grammar.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

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


More information about the libvir-list mailing list