[libvirt] [PATCH] network: fix networkValidate check for default portgroup and vlan

Eric Blake eblake at redhat.com
Thu Oct 25 16:59:22 UTC 2012


On 10/25/2012 09:22 AM, Laine Stump wrote:
> This was found during testing of the fix for:
> 
>    https://bugzilla.redhat.com/show_bug.cgi?id=868483
> 
> networkValidate was supposed to check for the existence of multiple
> portgroups and report an error if this was encountered. It did, but
> there were two problems:
> 
> 1) even though it logged an error, it still returned success, allowing
> the operation to continue.
> 
> 2) It could exit the portgroup checking loop early (or possibly not
> even do it once) if a vlan tag was supplied in the base network config
> or one of the portgroups.
> 
> This patch fixes networkValidate to return failure in addition to
> logging the error, and also changes it to not exit the portgroup
> checking loop early. The logic was a bit off in the checking for vlan
> anyway, and it's intertwined with fixing the early loop exit, so I
> fixed that as well. Now it correctly checks for combinations where a
> <virtualport> is specified in the base network def and <vlan> is given
> in a portgroup, as well as the opposite (<vlan> in base network def
> and <virtualport> in portgroup), and ignores the case of a disallowed
> vlan when using *no* portgroup if there is a default portgroup (since
> in that case there is no way to not use any portgroup).
> ---
>  src/network/bridge_driver.c | 42 +++++++++++++++++++++++++++++-------------
>  1 file changed, 29 insertions(+), 13 deletions(-)

ACK.

-- 
Eric Blake   eblake at 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: 617 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20121025/5313d776/attachment-0001.sig>


More information about the libvir-list mailing list