When defining and creating networks, we have been checking to make
sure there is only a single "default" portgroup, but haven't verified
that no two portgroups have the same name. We *do* check for multiple
definitions when updating the portgroups in an existing network
though.
This patch adds a check to networkValidate(), which is called when a
network is defined or created, to disallow duplicate names. It would
actually make sense to do this in the network XML parser (since it's
not really "something that might make sense but isn't supported by
this driver", but is instead "something that should never be
allowed"), but doing that carries the danger of causing errors when
rereading the config of existing networks when libvirtd is restarted
after an upgrade, and that would result in networks disappearing from
libvirt's list. (I'm thinking I should change the error to "XML_ERROR"
instead of "UNSUPPORTED", even though that's not the type of error
that networkValidate is intended for)
This resolves:
https://bugzilla.redhat.com/show_bug.cgi?id=1115858
---
src/network/bridge_driver.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
Wonder why our syntax-checker didn't flag the lack of spaces around '+'?
ACK
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library