]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
network driver: log error and abort network startup when radvd isn't found
authorLaine Stump <laine@laine.org>
Fri, 18 Mar 2011 17:05:08 +0000 (13:05 -0400)
committerLaine Stump <laine@laine.org>
Fri, 18 Mar 2011 18:53:45 +0000 (14:53 -0400)
This is detailed in:

  https://bugzilla.redhat.com/show_bug.cgi?id=688957

Since radvd is executed by daemonizing it, the attempt to exec the
radvd binary doesn't happen until after libvirtd has already received
an exit code from the intermediate forked process, so no error is
detected or logged by __virExec().

We can't require radvd as a prerequisite for the libvirt package (many
installations don't use IPv6, so they don't need it), so instead we
add in a check to verify there is an executable radvd binary prior to
trying to exec it.

src/network/bridge_driver.c

index 6a02df11aeb40731da550981bf50f82dbaf91096..c30620a63b1d46f55f7e4529b05f67ba092d1b22 100644 (file)
@@ -689,6 +689,14 @@ networkStartRadvd(virNetworkObjPtr network)
 
     network->radvdPid = -1;
 
+    if (access(RADVD, X_OK) < 0) {
+        virReportSystemError(errno,
+                             _("Cannot find %s - "
+                               "Possibly the package isn't installed"),
+                             RADVD);
+        goto cleanup;
+    }
+
     if ((err = virFileMakePath(NETWORK_PID_DIR)) != 0) {
         virReportSystemError(err,
                              _("cannot create directory %s"),