mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
Fix segfault when starting a domain with no cpu definition
My commit fba6bc4
iterated over the features in cpu definition
without checking if there is one.
This commit is contained in:
parent
d950494129
commit
1cd8f500ee
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user