mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 11:22:23 +00:00
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: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
a6d681485f
commit
c74207cb18
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user