mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-05 20:45:18 +00:00
nwfilter: grab driver lock earlier during init (bz96649)
This patch is in relation to Bug 966449:
https://bugzilla.redhat.com/show_bug.cgi?id=966449
This is a patch addressing the coredump.
Thread 1 must be calling nwfilterDriverRemoveDBusMatches(). It does so with
nwfilterDriverLock held. In the patch below I am now moving the
nwfilterDriverLock(driverState) further up so that the initialization, which
seems to either take a long time or is entirely stuck, occurs with the lock
held and the shutdown cannot occur at the same time.
Remove the lock in virNWFilterDriverIsWatchingFirewallD to avoid
double-locking.
(cherry picked from commit 0ec376c20a
)
This commit is contained in:
parent
364bbdc4cc
commit
0305c271fc
@ -188,6 +188,8 @@ nwfilterDriverStartup(int privileged)
|
|||||||
if (!privileged)
|
if (!privileged)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
nwfilterDriverLock(driverState);
|
||||||
|
|
||||||
if (virNWFilterIPAddrMapInit() < 0)
|
if (virNWFilterIPAddrMapInit() < 0)
|
||||||
goto err_free_driverstate;
|
goto err_free_driverstate;
|
||||||
if (virNWFilterLearnInit() < 0)
|
if (virNWFilterLearnInit() < 0)
|
||||||
@ -200,8 +202,6 @@ nwfilterDriverStartup(int privileged)
|
|||||||
if (virNWFilterConfLayerInit(virNWFilterDomainFWUpdateCB) < 0)
|
if (virNWFilterConfLayerInit(virNWFilterDomainFWUpdateCB) < 0)
|
||||||
goto err_techdrivers_shutdown;
|
goto err_techdrivers_shutdown;
|
||||||
|
|
||||||
nwfilterDriverLock(driverState);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* startup the DBus late so we don't get a reload signal while
|
* startup the DBus late so we don't get a reload signal while
|
||||||
* initializing
|
* initializing
|
||||||
@ -334,16 +334,10 @@ nwfilterDriverActive(void) {
|
|||||||
bool
|
bool
|
||||||
virNWFilterDriverIsWatchingFirewallD(void)
|
virNWFilterDriverIsWatchingFirewallD(void)
|
||||||
{
|
{
|
||||||
bool ret;
|
|
||||||
|
|
||||||
if (!driverState)
|
if (!driverState)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
nwfilterDriverLock(driverState);
|
return driverState->watchingFirewallD;
|
||||||
ret = driverState->watchingFirewallD;
|
|
||||||
nwfilterDriverUnlock(driverState);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user