mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-27 16:15:23 +00:00
lxc: create the required directories upon driver start
/var/run may reside on a tmpfs and we fail to create the PID file if /var/run/lxc does not exist. Since commit0a8addc1
, the lxc driver's state directory isn't automatically created before starting a domain. Now, the lxc driver makes sure the state directory exists when it initializes. Signed-off-by: Lubomir Rintel <lkundrak@v3.sk> (cherry picked from commitda33a1ac1f
)
This commit is contained in:
parent
ece6debbb0
commit
ed1cf00af8
@ -1650,6 +1650,13 @@ static int lxcStateInitialize(bool privileged,
|
|||||||
if (!(caps = virLXCDriverGetCapabilities(lxc_driver, false)))
|
if (!(caps = virLXCDriverGetCapabilities(lxc_driver, false)))
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
|
||||||
|
if (virFileMakePath(cfg->stateDir) < 0) {
|
||||||
|
virReportSystemError(errno,
|
||||||
|
_("Failed to mkdir %s"),
|
||||||
|
cfg->stateDir);
|
||||||
|
goto cleanup;
|
||||||
|
}
|
||||||
|
|
||||||
/* Get all the running persistent or transient configs first */
|
/* Get all the running persistent or transient configs first */
|
||||||
if (virDomainObjListLoadAllConfigs(lxc_driver->domains,
|
if (virDomainObjListLoadAllConfigs(lxc_driver->domains,
|
||||||
cfg->stateDir,
|
cfg->stateDir,
|
||||||
|
Loading…
Reference in New Issue
Block a user