]> xenbits.xensource.com Git - libvirt.git/commit
network: don't allow multiple portgroups with the same name in a network
authorLaine Stump <laine@laine.org>
Thu, 5 Feb 2015 19:20:54 +0000 (14:20 -0500)
committerLaine Stump <laine@laine.org>
Fri, 6 Feb 2015 15:37:54 +0000 (10:37 -0500)
commit2aa7ce6334ff192eb092932aee76d933f45cc39b
tree91e83c61b04f7dfb768a308ec4060130b73df7e5
parent8e724e9f3eab08ff1bef96ce1b3319558a86176b
network: don't allow multiple portgroups with the same name in a network

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