提交 bf5e3f65 编写于 作者: G Guido Günther

Make sure DNSMASQ_STATE_DIR exists

otherwise the directory returned by networkDnsmasqLeaseFileName will not
be created if ipdef->nhosts == 0 in networkBuildDnsmasqArgv.
上级 bf130d2c
...@@ -662,6 +662,13 @@ networkStartDhcpDaemon(virNetworkObjPtr network) ...@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册