]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Make sure DNSMASQ_STATE_DIR exists
authorGuido Günther <agx@sigxcpu.org>
Sat, 23 Apr 2011 12:28:44 +0000 (14:28 +0200)
committerGuido Günther <agx@sigxcpu.org>
Mon, 25 Apr 2011 21:41:57 +0000 (23:41 +0200)
otherwise the directory returned by networkDnsmasqLeaseFileName will not
be created if ipdef->nhosts == 0 in networkBuildDnsmasqArgv.

src/network/bridge_driver.c

index 8b5c1b613aa0e310ab7dad9c9086669df8a38fe1..ed78710d65c69701aa416186ebf408ddbd650021 100644 (file)
@@ -662,6 +662,13 @@ networkStartDhcpDaemon(virNetworkObjPtr network)
         goto cleanup;
     }
 
+    if ((err = virFileMakePath(DNSMASQ_STATE_DIR)) != 0) {
+        virReportSystemError(err,
+                             _("cannot create directory %s"),
+                             DNSMASQ_STATE_DIR);
+        goto cleanup;
+    }
+
     cmd = virCommandNew(DNSMASQ);
     if (networkBuildDnsmasqArgv(network, ipdef, pidfile, cmd) < 0) {
         goto cleanup;