提交 1166eeba 编写于 作者: D Daniel P. Berrange

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: NDaniel P. Berrange <berrange@redhat.com>
上级 b4ca2999
......@@ -1204,7 +1204,9 @@ int virLXCProcessStart(virConnectPtr conn,
}
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;
......@@ -1413,7 +1415,9 @@ virLXCProcessReconnectDomain(virDomainObjPtr vm,
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;
......
......@@ -707,7 +707,9 @@ qemuConnectCgroup(virQEMUDriverPtr driver,
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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册