mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00:00
Fix LXC driver crash when kernel doesn't support clone
* src/domain_conf.c: Make virDomainObjListFree a no-op if list is NULL * src/domain_event.c: make virDomainEventCallbackListFree a no-op if event list is NULL * src/lxc_driver.c: Log a message if LXC driver does not startup due to lacking kernel support
This commit is contained in:
parent
2d6a581960
commit
e403f8d43e
@ -532,6 +532,9 @@ void virDomainObjListFree(virDomainObjListPtr vms)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
if (!vms)
|
||||
return;
|
||||
|
||||
for (i = 0 ; i < vms->count ; i++)
|
||||
virDomainObjFree(vms->objs[i]);
|
||||
|
||||
|
@ -38,6 +38,9 @@ void
|
||||
virDomainEventCallbackListFree(virDomainEventCallbackListPtr list)
|
||||
{
|
||||
int i;
|
||||
if (!list)
|
||||
return;
|
||||
|
||||
for (i=0; i<list->count; i++) {
|
||||
virFreeCallback freecb = list->callbacks[i]->freecb;
|
||||
if (freecb)
|
||||
|
@ -1439,10 +1439,12 @@ static int lxcStartup(int privileged)
|
||||
lxcDriverLock(lxc_driver);
|
||||
|
||||
/* Check that this is a container enabled kernel */
|
||||
if(lxcContainerAvailable(0) < 0)
|
||||
if (lxcContainerAvailable(0) < 0) {
|
||||
VIR_INFO0("LXC support not available in this kernel, disabling driver");
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if(VIR_ALLOC(lxc_driver->domainEventCallbacks) < 0)
|
||||
if (VIR_ALLOC(lxc_driver->domainEventCallbacks) < 0)
|
||||
goto cleanup;
|
||||
if (!(lxc_driver->domainEventQueue = virDomainEventQueueNew()))
|
||||
goto cleanup;
|
||||
|
Loading…
Reference in New Issue
Block a user