mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00:00
Fix crashing upgrading from older libvirts with running guests
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>
This commit is contained in:
parent
b4ca299902
commit
1166eeba61
@ -1204,7 +1204,9 @@ int virLXCProcessStart(virConnectPtr conn,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (virCgroupNewDetectMachine(vm->def->name, "lxc", vm->pid,
|
if (virCgroupNewDetectMachine(vm->def->name, "lxc", vm->pid,
|
||||||
vm->def->resource->partition,
|
vm->def->resource ?
|
||||||
|
vm->def->resource->partition :
|
||||||
|
NULL,
|
||||||
-1, &priv->cgroup) < 0)
|
-1, &priv->cgroup) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
@ -1413,7 +1415,9 @@ virLXCProcessReconnectDomain(virDomainObjPtr vm,
|
|||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
if (virCgroupNewDetectMachine(vm->def->name, "lxc", vm->pid,
|
if (virCgroupNewDetectMachine(vm->def->name, "lxc", vm->pid,
|
||||||
vm->def->resource->partition,
|
vm->def->resource ?
|
||||||
|
vm->def->resource->partition :
|
||||||
|
NULL,
|
||||||
-1, &priv->cgroup) < 0)
|
-1, &priv->cgroup) < 0)
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
@ -707,7 +707,9 @@ qemuConnectCgroup(virQEMUDriverPtr driver,
|
|||||||
if (virCgroupNewDetectMachine(vm->def->name,
|
if (virCgroupNewDetectMachine(vm->def->name,
|
||||||
"qemu",
|
"qemu",
|
||||||
vm->pid,
|
vm->pid,
|
||||||
vm->def->resource->partition,
|
vm->def->resource ?
|
||||||
|
vm->def->resource->partition :
|
||||||
|
NULL,
|
||||||
cfg->cgroupControllers,
|
cfg->cgroupControllers,
|
||||||
&priv->cgroup) < 0)
|
&priv->cgroup) < 0)
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
|
Loading…
Reference in New Issue
Block a user