diff options
author | John Ferlan <jferlan@redhat.com> | 2017-05-30 15:30:42 -0400 |
---|---|---|
committer | John Ferlan <jferlan@redhat.com> | 2017-07-15 23:00:30 -0400 |
commit | 3a6e9a295072c29dae72241ed221e0baccefcbe7 (patch) | |
tree | e949b2dd6eac930a9194a5fb612dd7b59f702a06 /src/nwfilter | |
parent | fabbbfe2027fcbe24bfceb78237204910090f4c1 (diff) | |
download | libvirt-3a6e9a295072c29dae72241ed221e0baccefcbe7.tar.gz |
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>
Diffstat (limited to 'src/nwfilter')
-rw-r--r-- | src/nwfilter/nwfilter_gentech_driver.c | 62 |
1 files changed, 24 insertions, 38 deletions
diff --git a/src/nwfilter/nwfilter_gentech_driver.c b/src/nwfilter/nwfilter_gentech_driver.c index 552b5a0239..7ad22cec60 100644 --- a/src/nwfilter/nwfilter_gentech_driver.c +++ b/src/nwfilter/nwfilter_gentech_driver.c @@ -58,13 +58,13 @@ static virNWFilterTechDriverPtr filter_tech_drivers[] = { }; /* 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 * virNWFilterDoInstantiate which invokes virNWFilterDetermineMissingVarsRec * which invokes virNWFilterObjListFindByName. This iterates over every single * 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 - * __virNWFilterInstantiateFilter which will cause the other thread + * virNWFilterInstantiateFilterUpdate which will cause the other thread * to deadlock in virNWFilterObjListFindByName. * * XXX better long term solution is to make virNWFilterObjList use a @@ -777,18 +777,18 @@ virNWFilterDoInstantiate(const unsigned char *vmuuid, * Call this function while holding the NWFilter filter update lock */ static int -__virNWFilterInstantiateFilter(virNWFilterDriverStatePtr driver, - const unsigned char *vmuuid, - bool teardownOld, - const char *ifname, - int ifindex, - const char *linkdev, - const virMacAddr *macaddr, - const char *filtername, - virNWFilterHashTablePtr filterparams, - enum instCase useNewFilter, - bool forceWithPendingReq, - bool *foundNewFilter) +virNWFilterInstantiateFilterUpdate(virNWFilterDriverStatePtr driver, + const unsigned char *vmuuid, + bool teardownOld, + const char *ifname, + int ifindex, + const char *linkdev, + const virMacAddr *macaddr, + const char *filtername, + virNWFilterHashTablePtr filterparams, + enum instCase useNewFilter, + bool forceWithPendingReq, + bool *foundNewFilter) { int rc; const char *drvname = EBIPTABLES_DRIVER_ID; @@ -918,18 +918,11 @@ _virNWFilterInstantiateFilter(virNWFilterDriverStatePtr driver, goto cleanup; } - rc = __virNWFilterInstantiateFilter(driver, - vmuuid, - teardownOld, - net->ifname, - ifindex, - linkdev, - &net->mac, - net->filter, - net->filterparams, - useNewFilter, - false, - foundNewFilter); + rc = virNWFilterInstantiateFilterUpdate(driver, vmuuid, teardownOld, + net->ifname, ifindex, linkdev, + &net->mac, net->filter, + net->filterparams, useNewFilter, + false, foundNewFilter); cleanup: virMutexUnlock(&updateMutex); @@ -954,18 +947,11 @@ virNWFilterInstantiateFilterLate(virNWFilterDriverStatePtr driver, virNWFilterReadLockFilterUpdates(); virMutexLock(&updateMutex); - rc = __virNWFilterInstantiateFilter(driver, - vmuuid, - true, - ifname, - ifindex, - linkdev, - macaddr, - filtername, - filterparams, - INSTANTIATE_ALWAYS, - true, - &foundNewFilter); + rc = virNWFilterInstantiateFilterUpdate(driver, vmuuid, true, + ifname, ifindex, linkdev, + macaddr, filtername, filterparams, + INSTANTIATE_ALWAYS, true, + &foundNewFilter); if (rc < 0) { /* something went wrong... 'DOWN' the interface */ if ((virNetDevValidateConfig(ifname, NULL, ifindex) <= 0) || |