[libvirt] [PATCH] network: don't allow multiple portgroups with the same name in a network

Eric Blake eblake at redhat.com
Thu Feb 5 23:39:55 UTC 2015


On 02/05/2015 12:29 PM, Laine Stump wrote:
> 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(-)

> +        for (j = i+1; j < def->nPortGroups; j++) {

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 http://libvirt.org

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


More information about the libvir-list mailing list