mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-08 13:24:23 +00:00
lxccontainer: do_lxcapi_load_config()
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
e3246ab9c8
commit
d03ab308a7
@ -595,9 +595,10 @@ static bool load_config_locked(struct lxc_container *c, const char *fname)
|
|||||||
|
|
||||||
static bool do_lxcapi_load_config(struct lxc_container *c, const char *alt_file)
|
static bool do_lxcapi_load_config(struct lxc_container *c, const char *alt_file)
|
||||||
{
|
{
|
||||||
bool ret = false, need_disklock = false;
|
|
||||||
int lret;
|
int lret;
|
||||||
const char *fname;
|
const char *fname;
|
||||||
|
bool need_disklock = false, ret = false;
|
||||||
|
|
||||||
if (!c)
|
if (!c)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -606,10 +607,10 @@ static bool do_lxcapi_load_config(struct lxc_container *c, const char *alt_file)
|
|||||||
fname = alt_file;
|
fname = alt_file;
|
||||||
if (!fname)
|
if (!fname)
|
||||||
return false;
|
return false;
|
||||||
/*
|
|
||||||
* If we're reading something other than the container's config,
|
/* If we're reading something other than the container's config, we only
|
||||||
* we only need to lock the in-memory container. If loading the
|
* need to lock the in-memory container. If loading the container's
|
||||||
* container's config file, take the disk lock.
|
* config file, take the disk lock.
|
||||||
*/
|
*/
|
||||||
if (strcmp(fname, c->configfile) == 0)
|
if (strcmp(fname, c->configfile) == 0)
|
||||||
need_disklock = true;
|
need_disklock = true;
|
||||||
@ -627,6 +628,7 @@ static bool do_lxcapi_load_config(struct lxc_container *c, const char *alt_file)
|
|||||||
container_disk_unlock(c);
|
container_disk_unlock(c);
|
||||||
else
|
else
|
||||||
container_mem_unlock(c);
|
container_mem_unlock(c);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user