Make sure DNSMASQ_STATE_DIR exists

otherwise the directory returned by networkDnsmasqLeaseFileName will not
be created if ipdef->nhosts == 0 in networkBuildDnsmasqArgv.
This commit is contained in:
Guido Günther 2011-04-23 14:28:44 +02:00
parent bf130d2c85
commit bf5e3f6598

View File

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