]> xenbits.xensource.com Git - libvirt.git/commitdiff
Fix launch of libvirtd when DHCP snooping support is not available.
authorDaniel P. Berrange <berrange@redhat.com>
Fri, 15 Jun 2012 12:56:13 +0000 (13:56 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 15 Jun 2012 14:33:51 +0000 (15:33 +0100)
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

src/nwfilter/nwfilter_dhcpsnoop.c
src/nwfilter/nwfilter_gentech_driver.c
src/nwfilter/nwfilter_learnipaddr.c

index 22f76e2098e4b3a33042f4fb5f8288a8e83c0dd9..5dffaad40ab2d83102ab5899477aad082e839106 100644 (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
index 4769d21d4f50bdd64ae9e838c5a291bfdd39eec9..d833bbb33e90b70f9fd46066540d5ccfe4f4fa97 100644 (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);
index af13738122e3d11ab432d700bf8ce2e3ff880e21..a891377c1461952551bb25ee7f6f9ef9615ec9be 100644 (file)
@@ -782,6 +782,7 @@ virNWFilterLearnInit(void) {
     if (pendingLearnReq)
         return 0;
 
+    VIR_DEBUG("Initializing IP address learning");
     threadsTerminate = false;
 
     pendingLearnReq = virHashCreate(0, freeLearnReqEntry);