If upgrading from a libvirt that is older than 1.0.5, we can
not assume that vm->def->resource is non-NULL. This bogus
assumption caused libvirtd to crash
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
}
if (virCgroupNewDetectMachine(vm->def->name, "lxc", vm->pid,
- vm->def->resource->partition,
+ vm->def->resource ?
+ vm->def->resource->partition :
+ NULL,
-1, &priv->cgroup) < 0)
goto error;
goto error;
if (virCgroupNewDetectMachine(vm->def->name, "lxc", vm->pid,
- vm->def->resource->partition,
+ vm->def->resource ?
+ vm->def->resource->partition :
+ NULL,
-1, &priv->cgroup) < 0)
goto error;
if (virCgroupNewDetectMachine(vm->def->name,
"qemu",
vm->pid,
- vm->def->resource->partition,
+ vm->def->resource ?
+ vm->def->resource->partition :
+ NULL,
cfg->cgroupControllers,
&priv->cgroup) < 0)
goto cleanup;