]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
528575 avoid libvirtd crash on LCX domain autostart
authorDaniel Veillard <veillard@redhat.com>
Wed, 21 Oct 2009 11:32:20 +0000 (13:32 +0200)
committerDaniel Veillard <veillard@redhat.com>
Wed, 21 Oct 2009 11:32:20 +0000 (13:32 +0200)
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
src/lxc/lxc_conf.h

index de059bd8b52da244d33beb06360f03eba38a977b..74dc3674765130e35114eedd3b7294188bc74c86 100644 (file)
@@ -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;
index 6e4c8553cccbf57784a900e802a3d4ed0e2e7641..499617fb648b475fdf7020274d841c1740058b29 100644 (file)
@@ -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 {