]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commit
schemas: Allow all generic elements and attributes for all interfaces
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 28 Jan 2015 17:14:22 +0000 (18:14 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 29 Jan 2015 15:23:15 +0000 (16:23 +0100)
commit522225684907af09ce4213a365cc98b5881e3eae
tree770ffc9364d2eefe4bb542bafc548a833532026f
parent436dcf0b7476c4ad25b7d6e43e52b3553978d92a
schemas: Allow all generic elements and attributes for all interfaces

There are some interface types (notably 'server' and 'client')
which instead of allowing the default set of elements and
attributes (like the rest do), try to enumerate only the elements
they know of. This way it's, however, easy to miss something. For
instance, the <address/> element was not mentioned at all. This
resulted in a strange behavior: when such interface was added
into XML, the address was automatically generated by parsing
code. Later, the formatted XML hasn't passed the RNG schema. This
became more visible once we've turned on the XML validation on
domain XML changes: appending an empty line at the end of
formatted XML (to trick virsh think the XML had changed) made
libvirt to refuse the very same XML it formatted.

Instead of trying to find each element and attribute we are
missing in the schema, lets just allow all the elements and
attributes like we're doing that for the rest of types. It's no
harm if the schema is wider than our parser allows.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
docs/schemas/domaincommon.rng
tests/qemuxml2argvdata/qemuxml2argv-interface-server.xml [new file with mode: 0644]
tests/qemuxml2xmltest.c