[PATCHv2 2/7] network: set interface actual trustGuestRxFilters from network/portgroup

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

 



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.
---
changes from V1:

* don't compare to VIR_TRISTATE_BOOL_ABSENT - just see if it is non-0.

 src/network/bridge_driver.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c
index 979fb13..5f2e778 100644
--- a/src/network/bridge_driver.c
+++ b/src/network/bridge_driver.c
@@ -3794,6 +3794,16 @@ networkAllocateActualDevice(virDomainDefPtr dom,
     if (vlan && virNetDevVlanCopy(&iface->data.network.actual->vlan, vlan) < 0)
         goto error;
 
+    if (iface->trustGuestRxFilters)
+       iface->data.network.actual->trustGuestRxFilters
+          = iface->trustGuestRxFilters;
+    else if (portgroup && portgroup->trustGuestRxFilters)
+       iface->data.network.actual->trustGuestRxFilters
+          = portgroup->trustGuestRxFilters;
+    else if (netdef->trustGuestRxFilters)
+       iface->data.network.actual->trustGuestRxFilters
+          = netdef->trustGuestRxFilters;
+
     if ((netdef->forward.type == VIR_NETWORK_FORWARD_NONE) ||
         (netdef->forward.type == VIR_NETWORK_FORWARD_NAT) ||
         (netdef->forward.type == VIR_NETWORK_FORWARD_ROUTE)) {
-- 
1.9.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]