[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt] [PATCH 2/6] network: set interface actual trustGuestRxFilters from network/portgroup




On 09/24/2014 05:50 AM, Laine Stump wrote:
> As is done with other items such as vlan, virtualport, and bandwidth,
> set the actual trustGuestRxFilters value to be used by a domain
> interface according to a merge of the same attribute in the interface,
> portgroup, and network in use. the interface setting always takes
> precedence (if specified), followed by portgroup, and finally the
> setting in the network is used if it's not specified in the interface
> or portgroup.
> ---
>  src/network/bridge_driver.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
> index 979fb13..548e354 100644
> --- a/src/network/bridge_driver.c
> +++ b/src/network/bridge_driver.c
> @@ -3794,6 +3794,17 @@ networkAllocateActualDevice(virDomainDefPtr dom,
>      if (vlan && virNetDevVlanCopy(&iface->data.network.actual->vlan, vlan) < 0)
>          goto error;
>  
> +    if (iface->trustGuestRxFilters != VIR_TRISTATE_BOOL_ABSENT)
> +       iface->data.network.actual->trustGuestRxFilters
> +          = iface->trustGuestRxFilters;
> +    else if (portgroup &&
> +             portgroup->trustGuestRxFilters != VIR_TRISTATE_BOOL_ABSENT)
> +       iface->data.network.actual->trustGuestRxFilters
> +          = portgroup->trustGuestRxFilters;
> +    else if (netdef->trustGuestRxFilters != VIR_TRISTATE_BOOL_ABSENT)
> +       iface->data.network.actual->trustGuestRxFilters
> +          = netdef->trustGuestRxFilters;
> +

Since BOOL_ABSENT is 0 - you don't "need" the comparison - it may look
cleaner too

ACK either way

John

>      if ((netdef->forward.type == VIR_NETWORK_FORWARD_NONE) ||
>          (netdef->forward.type == VIR_NETWORK_FORWARD_NAT) ||
>          (netdef->forward.type == VIR_NETWORK_FORWARD_ROUTE)) {
> 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]