nwfilter: Rename virNWFilterInstantiate

Rename to virNWFilterDoInstantiate to better describe the action.

Also fix the @vmuuid parameter to not have the ATTRIBUTE_UNUSED since it
is used in the call to virNWFilterDHCPSnoopReq.

Signed-off-by: John Ferlan <jferlan@redhat.com>
This commit is contained in:
John Ferlan 2017-05-30 15:23:42 -04:00
parent 54c226c10b
commit fabbbfe202

View File

@ -60,7 +60,7 @@ 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 __virNWFilterInstantiateFilter
* will hold a lock on a virNWFilterObjPtr. This in turn invokes * will hold a lock on a virNWFilterObjPtr. This in turn invokes
* virNWFilterInstantiate 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
@ -605,7 +605,7 @@ virNWFilterDetermineMissingVarsRec(virNWFilterDefPtr filter,
/** /**
* virNWFilterInstantiate: * virNWFilterDoInstantiate:
* @vmuuid: The UUID of the VM * @vmuuid: The UUID of the VM
* @techdriver: The driver to use for instantiation * @techdriver: The driver to use for instantiation
* @filter: The filter to instantiate * @filter: The filter to instantiate
@ -625,18 +625,19 @@ virNWFilterDetermineMissingVarsRec(virNWFilterDefPtr filter,
* Call this function while holding the NWFilter filter update lock * Call this function while holding the NWFilter filter update lock
*/ */
static int static int
virNWFilterInstantiate(const unsigned char *vmuuid ATTRIBUTE_UNUSED, virNWFilterDoInstantiate(const unsigned char *vmuuid,
virNWFilterTechDriverPtr techdriver, virNWFilterTechDriverPtr techdriver,
virNWFilterDefPtr filter, virNWFilterDefPtr filter,
const char *ifname, const char *ifname,
int ifindex, int ifindex,
const char *linkdev, const char *linkdev,
virNWFilterHashTablePtr vars, virNWFilterHashTablePtr vars,
enum instCase useNewFilter, bool *foundNewFilter, enum instCase useNewFilter,
bool teardownOld, bool *foundNewFilter,
const virMacAddr *macaddr, bool teardownOld,
virNWFilterDriverStatePtr driver, const virMacAddr *macaddr,
bool forceWithPendingReq) virNWFilterDriverStatePtr driver,
bool forceWithPendingReq)
{ {
int rc; int rc;
virNWFilterInst inst; virNWFilterInst inst;
@ -868,18 +869,11 @@ __virNWFilterInstantiateFilter(virNWFilterDriverStatePtr driver,
break; break;
} }
rc = virNWFilterInstantiate(vmuuid, rc = virNWFilterDoInstantiate(vmuuid, techdriver, filter,
techdriver, ifname, ifindex, linkdev,
filter, vars, useNewFilter, foundNewFilter,
ifname, teardownOld, macaddr, driver,
ifindex, forceWithPendingReq);
linkdev,
vars,
useNewFilter, foundNewFilter,
teardownOld,
macaddr,
driver,
forceWithPendingReq);
virNWFilterHashTableFree(vars); virNWFilterHashTableFree(vars);