From 09c64d0072857922aabff90392b3334aa2d1fde5 Mon Sep 17 00:00:00 2001 From: Daniel Veillard Date: Wed, 21 Oct 2009 13:32:20 +0200 Subject: [PATCH] 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 --- src/lxc/lxc_conf.c | 3 +++ src/lxc/lxc_conf.h | 1 + 2 files changed, 4 insertions(+) diff --git a/src/lxc/lxc_conf.c b/src/lxc/lxc_conf.c index de059bd8b5..74dc367476 100644 --- a/src/lxc/lxc_conf.c +++ b/src/lxc/lxc_conf.c @@ -102,6 +102,9 @@ int lxcLoadDriverConfig(lxc_driver_t *driver) goto no_memory; if ((driver->logDir = strdup(LXC_LOG_DIR)) == NULL) goto no_memory; + if ((driver->autostartDir = strdup(LXC_AUTOSTART_DIR)) == NULL) + goto no_memory; + if ((filename = strdup(SYSCONF_DIR "/libvirt/lxc.conf")) == NULL) goto no_memory; diff --git a/src/lxc/lxc_conf.h b/src/lxc/lxc_conf.h index 6e4c8553cc..499617fb64 100644 --- a/src/lxc/lxc_conf.h +++ b/src/lxc/lxc_conf.h @@ -36,6 +36,7 @@ #define LXC_CONFIG_DIR SYSCONF_DIR "/libvirt/lxc" #define LXC_STATE_DIR LOCAL_STATE_DIR "/run/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; struct __lxc_driver { -- GitLab