mirror of
https://github.com/libvirt/libvirt.git
synced 2026-10-02 12:20:06 -05:00
network: create statedir during driver initialization
This directory should be created when the network driver is first started up, not just when a dhcp daemon is run. This hasn't posed a problem in the past, because the directory has always been pre-existing.
This commit is contained in:
1 parent
440beeb7ac
commit
8aaa5b68ef
1 file changed
+7
-6
@@ -487,6 +487,13 @@ networkStateInitialize(bool privileged,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (virFileMakePath(driverState->stateDir) < 0) {
|
||||||
|
virReportSystemError(errno,
|
||||||
|
_("cannot create directory %s"),
|
||||||
|
driverState->stateDir);
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
/* if this fails now, it will be retried later with dnsmasqCapsRefresh() */
|
/* if this fails now, it will be retried later with dnsmasqCapsRefresh() */
|
||||||
driverState->dnsmasqCaps = dnsmasqCapsNewFromBinary(DNSMASQ);
|
driverState->dnsmasqCaps = dnsmasqCapsNewFromBinary(DNSMASQ);
|
||||||
|
|
||||||
@@ -1171,12 +1178,6 @@ networkStartDhcpDaemon(virNetworkDriverStatePtr driver,
|
|||||||
driverState->pidDir);
|
driverState->pidDir);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
if (virFileMakePath(driverState->stateDir) < 0) {
|
|
||||||
virReportSystemError(errno,
|
|
||||||
_("cannot create directory %s"),
|
|
||||||
driverState->stateDir);
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!(pidfile = virPidFileBuildPath(driverState->pidDir,
|
if (!(pidfile = virPidFileBuildPath(driverState->pidDir,
|
||||||
network->def->name)))
|
network->def->name)))
|
||||||
|
|||||||
Reference in new issue
Block a user