提交 09c64d00 编写于 作者: D Daniel Veillard

528575 avoid libvirtd crash on LCX domain autostart

https://bugzilla.redhat.com/show_bug.cgi?id=528575
virsh -c lxc:/// autostart vm1
was crashing the daemon

* src/lxc/lxc_conf.h src/lxc/lxc_conf.c: initialize the driver
  autostartDir to avoid a NULL reference and implement autostart for LXC
上级 949dd07b
...@@ -102,6 +102,9 @@ int lxcLoadDriverConfig(lxc_driver_t *driver) ...@@ -102,6 +102,9 @@ int lxcLoadDriverConfig(lxc_driver_t *driver)
goto no_memory; goto no_memory;
if ((driver->logDir = strdup(LXC_LOG_DIR)) == NULL) if ((driver->logDir = strdup(LXC_LOG_DIR)) == NULL)
goto no_memory; goto no_memory;
if ((driver->autostartDir = strdup(LXC_AUTOSTART_DIR)) == NULL)
goto no_memory;
if ((filename = strdup(SYSCONF_DIR "/libvirt/lxc.conf")) == NULL) if ((filename = strdup(SYSCONF_DIR "/libvirt/lxc.conf")) == NULL)
goto no_memory; goto no_memory;
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#define LXC_CONFIG_DIR SYSCONF_DIR "/libvirt/lxc" #define LXC_CONFIG_DIR SYSCONF_DIR "/libvirt/lxc"
#define LXC_STATE_DIR LOCAL_STATE_DIR "/run/libvirt/lxc" #define LXC_STATE_DIR LOCAL_STATE_DIR "/run/libvirt/lxc"
#define LXC_LOG_DIR LOCAL_STATE_DIR "/log/libvirt/lxc" #define LXC_LOG_DIR LOCAL_STATE_DIR "/log/libvirt/lxc"
#define LXC_AUTOSTART_DIR LXC_CONFIG_DIR "/autostart"
typedef struct __lxc_driver lxc_driver_t; typedef struct __lxc_driver lxc_driver_t;
struct __lxc_driver { struct __lxc_driver {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册