mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-25 07:05:28 +00:00
LXC complement PATH environment variable
* src/lxc/lxc_driver.c: without PATH, the controller will definitely fail to call ip command
This commit is contained in:
parent
2d8d9b100b
commit
c396fb36fa
@ -1005,6 +1005,19 @@ static int lxcControllerStart(virConnectPtr conn,
|
||||
lenv[lenvc++] = envval; \
|
||||
} while (0)
|
||||
|
||||
#define ADD_ENV_COPY(envname) \
|
||||
do { \
|
||||
char *val = getenv(envname); \
|
||||
if (val != NULL) { \
|
||||
ADD_ENV_PAIR(envname, val); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* The controller may call ip command, so we have to remain PATH.
|
||||
*/
|
||||
ADD_ENV_COPY("PATH");
|
||||
|
||||
log_level = virLogGetDefaultPriority();
|
||||
if (virAsprintf(&tmp, "LIBVIRT_DEBUG=%d", log_level) < 0)
|
||||
goto no_memory;
|
||||
|
Loading…
Reference in New Issue
Block a user