From bf5e3f65986623c79bc651d331c732ea02f66ef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guido=20G=C3=BCnther?= Date: Sat, 23 Apr 2011 14:28:44 +0200 Subject: [PATCH] Make sure DNSMASQ_STATE_DIR exists otherwise the directory returned by networkDnsmasqLeaseFileName will not be created if ipdef->nhosts == 0 in networkBuildDnsmasqArgv. --- src/network/bridge_driver.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/network/bridge_driver.c b/src/network/bridge_driver.c index 8b5c1b613a..ed78710d65 100644 --- a/src/network/bridge_driver.c +++ b/src/network/bridge_driver.c @@ -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; -- GitLab