[libvirt] [PATCH] qemu: eliminate bogus error log when changing netdev's bridge

Peter Krempa pkrempa at redhat.com
Mon Dec 10 18:03:24 UTC 2012


On 12/10/12 18:45, Laine Stump wrote:
> This fixes a problem that showed up during testing of:
>
>    https://bugzilla.redhat.com/show_bug.cgi?id=881480
>
> Due to a logic error in the function that gets the name of the bridge
> an interface connects to, any time a bridge was specified directly
> (type='bridge') rather than indirectly (type='network'), An error
> would be logged (although the operation would then complete
> successfully):
>
>     Network type 6 is not supported
>
> The final virReportError() in the function
> qemuDomainNetGetBridgeName() was apparently avoided in the past with a
> "goto cleanup" at the end of each case, but the case of bridge somehow
> no longer has that final goto cleanup.
>
> The proper solution is anyway to not rely on goto's, but put the error
> log inside an else {} clause, so that it's executed only if the type
> is neither bridge nor network (in reality, this function should only
> ever be called for those two types, that's why this is an internal
> error).
>
> While making this change, the error message was also tuned to be more
> correct (since it's not really the type of the network, but the type
> of the interface, and it *is* otherwise supported, it's just that the
> interface type in question doesn't *have* a bridge device associated
> with it, or at least we don't know how to get it).
> ---
>   src/qemu/qemu_hotplug.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
>
Hm, agreed, the new logic looks better.

ACK

Peter





More information about the libvir-list mailing list