提交 c74207cb 编写于 作者: J Jiri Denemark

qemu: Don't try to update undefined guest CPU

Calling virCPUUpdateLive on a domain with no guest CPU configuration
does not make sense. Especially when doing so would crash libvirtd.
Signed-off-by: NJiri Denemark <jdenemar@redhat.com>
上级 a6d68148
......@@ -3815,11 +3815,6 @@ qemuProcessVerifyCPUFeatures(virDomainDefPtr def,
{
int rc;
if (!def->cpu ||
(def->cpu->mode == VIR_CPU_MODE_CUSTOM &&
!def->cpu->model))
return 0;
rc = virCPUCheckFeature(def->os.arch, def->cpu, "invtsc");
if (rc < 0) {
......@@ -3870,6 +3865,13 @@ qemuProcessUpdateLiveGuestCPU(virQEMUDriverPtr driver,
qemuProcessVerifyHypervFeatures(def, cpu) < 0)
goto cleanup;
if (!def->cpu ||
(def->cpu->mode == VIR_CPU_MODE_CUSTOM &&
!def->cpu->model)) {
ret = 0;
goto cleanup;
}
if (qemuProcessVerifyCPUFeatures(def, cpu) < 0)
goto cleanup;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册