Fix launch of libvirtd when DHCP snooping support is not available.

When libpcap is not available, the NWFilter driver provides a
no-op stub for the DHCP snooping initialization. This was
mistakenly returning '-1' instead of '0', so the entire driver
initialization failed
This commit is contained in:
Daniel P. Berrange 2012-06-15 13:56:13 +01:00
parent 50312d4b91
commit b9852862ea
3 changed files with 6 additions and 1 deletions

View File

@ -2056,6 +2056,8 @@ virNWFilterDHCPSnoopInit(void)
if (virNWFilterSnoopState.snoopReqs)
return 0;
VIR_DEBUG("Initializing DHCP snooping");
if (virMutexInitRecursive(&virNWFilterSnoopState.snoopLock) < 0 ||
virMutexInit(&virNWFilterSnoopState.activeLock) < 0 ||
virAtomicIntInit(&virNWFilterSnoopState.nLeases) < 0 ||
@ -2176,7 +2178,8 @@ virNWFilterDHCPSnoopShutdown(void)
int
virNWFilterDHCPSnoopInit(void)
{
return -1;
VIR_DEBUG("No DHCP snooping support available");
return 0;
}
void

View File

@ -57,6 +57,7 @@ static virNWFilterTechDriverPtr filter_tech_drivers[] = {
void virNWFilterTechDriversInit(bool privileged) {
int i = 0;
VIR_DEBUG("Initializing NWFilter technology drivers");
while (filter_tech_drivers[i]) {
if (!(filter_tech_drivers[i]->flags & TECHDRV_FLAG_INITIALIZED))
filter_tech_drivers[i]->init(privileged);

View File

@ -782,6 +782,7 @@ virNWFilterLearnInit(void) {
if (pendingLearnReq)
return 0;
VIR_DEBUG("Initializing IP address learning");
threadsTerminate = false;
pendingLearnReq = virHashCreate(0, freeLearnReqEntry);