diff --git a/src/qemu/qemu_migration.c b/src/qemu/qemu_migration.c index bbfb09ac34..99d4c4a799 100644 --- a/src/qemu/qemu_migration.c +++ b/src/qemu/qemu_migration.c @@ -1513,7 +1513,7 @@ qemuMigrationIsAllowed(virQEMUDriverPtr driver, virDomainObjPtr vm, return false; } - for (i = 0; i < def->cpu->nfeatures; i++) { + for (i = 0; def->cpu && i < def->cpu->nfeatures; i++) { virCPUFeatureDefPtr feature = &def->cpu->features[i]; if (feature->policy != VIR_CPU_FEATURE_REQUIRE) diff --git a/src/qemu/qemu_process.c b/src/qemu/qemu_process.c index a39cc0a0aa..570960e669 100644 --- a/src/qemu/qemu_process.c +++ b/src/qemu/qemu_process.c @@ -3636,7 +3636,7 @@ qemuProcessVerifyGuestCPU(virQEMUDriverPtr driver, virDomainObjPtr vm) } } - for (i = 0; i < def->cpu->nfeatures; i++) { + for (i = 0; def->cpu && i < def->cpu->nfeatures; i++) { virCPUFeatureDefPtr feature = &def->cpu->features[i]; if (feature->policy != VIR_CPU_FEATURE_REQUIRE)