[libvirt] [PATCH] 528575 avoid libvirtd crash on LCX domain autostart

Ryota Ozaki ozaki.ryota at gmail.com
Wed Oct 21 10:31:11 UTC 2009


On Wed, Oct 21, 2009 at 6:55 PM, Daniel P. Berrange <berrange at redhat.com> wrote:
> On Wed, Oct 21, 2009 at 11:52:42AM +0200, Daniel Veillard wrote:
>>   https://bugzilla.redhat.com/show_bug.cgi?id=528575
>>
>> virsh -c lxc:/// autostart vm1
>>
>> crash the daemon because the driver autostartDir is never initialized
>> and we do a NULL dereference. The enclosed patch is trivial and avoid
>> the crash, but ...
>>
>> [root at paphio ~]# virsh -c lxc:/// dominfo vm1
>> Id:             -
>> Name:           vm1
>> UUID:           d320f760-7541-6633-fd42-4f984fca9f51
>> OS Type:        exe
>> State:          shut off
>> CPU(s):         1
>> Max memory:     500000 kB
>> Used memory:    500000 kB
>> Autostart:      enable
>>
>> while the domain is properly flagged as autostarting it doesn't seem to
>> actually autostart, and the driver->autostartDir directory is not
>> created on the fly as I would expect, i.e.
>>   /etc/libvirt/lxc/autostart/
>> still doesn't exist and the domain is marked as off and Autostart: enable
>
> That's because of :
>
>> diff --git a/src/lxc/lxc_conf.h b/src/lxc/lxc_conf.h
>> index 6e4c855..eca8c7c 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 LOCAL_STATE_DIR "/libvirt/lxc/autostart"
>
> LOCAL_STATE_DIR expands to /var
>
> The autostart dir should be  defined as
>
>  #define LXC_AUTOSTART_DIR  LXC_CONFIG_DIR "/autostart"

Yes, that's correct. I've confirmed it fixes the defect in my environment.
So ACK to the revised one.

BTW, actually I've never used autostart feature though, when autostart-enabled
domains boot up? 'service libvirtd restart' seems not kicking my lxc...

  ozaki-r

>
> Regards,
> Daniel
> --
> |: Red Hat, Engineering, London   -o-   http://people.redhat.com/berrange/ :|
> |: http://libvirt.org  -o-  http://virt-manager.org  -o-  http://ovirt.org :|
> |: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
> |: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|
>
> --
> Libvir-list mailing list
> Libvir-list at redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list
>




More information about the libvir-list mailing list