mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 19:11:16 +00:00
nwfilter: Rename __virNWFilterInstantiateFilter
Rename to virNWFilterInstantiateFilterUpdate and alter the callers to not have one parameter per line. Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
parent
fabbbfe202
commit
3a6e9a2950
@ -58,13 +58,13 @@ static virNWFilterTechDriverPtr filter_tech_drivers[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Serializes instantiation of filters. This is necessary
|
/* Serializes instantiation of filters. This is necessary
|
||||||
* to avoid lock ordering deadlocks. eg __virNWFilterInstantiateFilter
|
* to avoid lock ordering deadlocks. eg virNWFilterInstantiateFilterUpdate
|
||||||
* will hold a lock on a virNWFilterObjPtr. This in turn invokes
|
* will hold a lock on a virNWFilterObjPtr. This in turn invokes
|
||||||
* virNWFilterDoInstantiate which invokes virNWFilterDetermineMissingVarsRec
|
* virNWFilterDoInstantiate which invokes virNWFilterDetermineMissingVarsRec
|
||||||
* which invokes virNWFilterObjListFindByName. This iterates over every single
|
* which invokes virNWFilterObjListFindByName. This iterates over every single
|
||||||
* virNWFilterObjPtr in the list. So if 2 threads try to instantiate a
|
* virNWFilterObjPtr in the list. So if 2 threads try to instantiate a
|
||||||
* filter in parallel, they'll both hold 1 lock at the top level in
|
* filter in parallel, they'll both hold 1 lock at the top level in
|
||||||
* __virNWFilterInstantiateFilter which will cause the other thread
|
* virNWFilterInstantiateFilterUpdate which will cause the other thread
|
||||||
* to deadlock in virNWFilterObjListFindByName.
|
* to deadlock in virNWFilterObjListFindByName.
|
||||||
*
|
*
|
||||||
* XXX better long term solution is to make virNWFilterObjList use a
|
* XXX better long term solution is to make virNWFilterObjList use a
|
||||||
@ -777,7 +777,7 @@ virNWFilterDoInstantiate(const unsigned char *vmuuid,
|
|||||||
* Call this function while holding the NWFilter filter update lock
|
* Call this function while holding the NWFilter filter update lock
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
__virNWFilterInstantiateFilter(virNWFilterDriverStatePtr driver,
|
virNWFilterInstantiateFilterUpdate(virNWFilterDriverStatePtr driver,
|
||||||
const unsigned char *vmuuid,
|
const unsigned char *vmuuid,
|
||||||
bool teardownOld,
|
bool teardownOld,
|
||||||
const char *ifname,
|
const char *ifname,
|
||||||
@ -918,18 +918,11 @@ _virNWFilterInstantiateFilter(virNWFilterDriverStatePtr driver,
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = __virNWFilterInstantiateFilter(driver,
|
rc = virNWFilterInstantiateFilterUpdate(driver, vmuuid, teardownOld,
|
||||||
vmuuid,
|
net->ifname, ifindex, linkdev,
|
||||||
teardownOld,
|
&net->mac, net->filter,
|
||||||
net->ifname,
|
net->filterparams, useNewFilter,
|
||||||
ifindex,
|
false, foundNewFilter);
|
||||||
linkdev,
|
|
||||||
&net->mac,
|
|
||||||
net->filter,
|
|
||||||
net->filterparams,
|
|
||||||
useNewFilter,
|
|
||||||
false,
|
|
||||||
foundNewFilter);
|
|
||||||
|
|
||||||
cleanup:
|
cleanup:
|
||||||
virMutexUnlock(&updateMutex);
|
virMutexUnlock(&updateMutex);
|
||||||
@ -954,17 +947,10 @@ virNWFilterInstantiateFilterLate(virNWFilterDriverStatePtr driver,
|
|||||||
virNWFilterReadLockFilterUpdates();
|
virNWFilterReadLockFilterUpdates();
|
||||||
virMutexLock(&updateMutex);
|
virMutexLock(&updateMutex);
|
||||||
|
|
||||||
rc = __virNWFilterInstantiateFilter(driver,
|
rc = virNWFilterInstantiateFilterUpdate(driver, vmuuid, true,
|
||||||
vmuuid,
|
ifname, ifindex, linkdev,
|
||||||
true,
|
macaddr, filtername, filterparams,
|
||||||
ifname,
|
INSTANTIATE_ALWAYS, true,
|
||||||
ifindex,
|
|
||||||
linkdev,
|
|
||||||
macaddr,
|
|
||||||
filtername,
|
|
||||||
filterparams,
|
|
||||||
INSTANTIATE_ALWAYS,
|
|
||||||
true,
|
|
||||||
&foundNewFilter);
|
&foundNewFilter);
|
||||||
if (rc < 0) {
|
if (rc < 0) {
|
||||||
/* something went wrong... 'DOWN' the interface */
|
/* something went wrong... 'DOWN' the interface */
|
||||||
|
Loading…
Reference in New Issue
Block a user