mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 19:32:19 +00:00
vz: trustGuestRxFilters fixes
First we need to always set value to vz sdk parameter so we can leverage setting code for device updates. This patch resolves tristate default to off implicitly. This is easier then extract default value from vz sdk itself. First current default is off too, second this approach is already taken for 'net->linkstate'. Second dump this option in domain xml. Signed-off-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
This commit is contained in:
parent
3a82c04c09
commit
3a622f6b32
@ -883,7 +883,7 @@ prlsdkGetNetInfo(PRL_HANDLE netAdapter, virDomainNetDefPtr net, bool isCt)
|
|||||||
PRL_UINT32 netAdapterIndex;
|
PRL_UINT32 netAdapterIndex;
|
||||||
PRL_UINT32 emulatedType;
|
PRL_UINT32 emulatedType;
|
||||||
PRL_RESULT pret;
|
PRL_RESULT pret;
|
||||||
PRL_BOOL isConnected;
|
PRL_BOOL isConnected, isMacFilter;
|
||||||
int ret = -1;
|
int ret = -1;
|
||||||
|
|
||||||
/* use device name, shown by prlctl as target device
|
/* use device name, shown by prlctl as target device
|
||||||
@ -982,6 +982,12 @@ prlsdkGetNetInfo(PRL_HANDLE netAdapter, virDomainNetDefPtr net, bool isCt)
|
|||||||
else
|
else
|
||||||
net->linkstate = VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN;
|
net->linkstate = VIR_DOMAIN_NET_INTERFACE_LINK_STATE_DOWN;
|
||||||
|
|
||||||
|
pret = PrlVmDevNet_IsPktFilterPreventMacSpoof(netAdapter, &isMacFilter);
|
||||||
|
prlsdkCheckRetGoto(pret, cleanup);
|
||||||
|
|
||||||
|
net->trustGuestRxFilters = isMacFilter ? VIR_TRISTATE_BOOL_YES :
|
||||||
|
VIR_TRISTATE_BOOL_NO;
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
cleanup:
|
cleanup:
|
||||||
return ret;
|
return ret;
|
||||||
@ -3171,10 +3177,8 @@ static int prlsdkConfigureNet(vzDriverPtr driver,
|
|||||||
prlsdkCheckRetGoto(pret, cleanup);
|
prlsdkCheckRetGoto(pret, cleanup);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (net->trustGuestRxFilters == VIR_TRISTATE_BOOL_YES)
|
pret = PrlVmDevNet_SetPktFilterPreventMacSpoof(sdknet,
|
||||||
pret = PrlVmDevNet_SetPktFilterPreventMacSpoof(sdknet, 0);
|
net->trustGuestRxFilters == VIR_TRISTATE_BOOL_YES);
|
||||||
else if (net->trustGuestRxFilters == VIR_TRISTATE_BOOL_NO)
|
|
||||||
pret = PrlVmDevNet_SetPktFilterPreventMacSpoof(sdknet, 1);
|
|
||||||
prlsdkCheckRetGoto(pret, cleanup);
|
prlsdkCheckRetGoto(pret, cleanup);
|
||||||
|
|
||||||
ret = 0;
|
ret = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user