VIR_DEBUG("host=%p, cpu=%p", host, cpu);
- if (!cpu->model) {
- virReportError(VIR_ERR_INVALID_ARG, "%s",
- _("no guest CPU model specified"));
- return VIR_CPU_COMPARE_ERROR;
- }
-
if ((driver = cpuGetSubDriver(host->arch)) == NULL)
return VIR_CPU_COMPARE_ERROR;
VIR_DEBUG("host=%p, guest=%p, data=%p, msg=%p", host, guest, data, msg);
- if (!guest->model) {
- virReportError(VIR_ERR_INVALID_ARG, "%s",
- _("no guest CPU model specified"));
- return VIR_CPU_COMPARE_ERROR;
- }
-
if ((driver = cpuGetSubDriver(host->arch)) == NULL)
return VIR_CPU_COMPARE_ERROR;
size_t i;
unsigned int reqfeatures;
+ if (!cpu->model) {
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
+ _("no guest CPU model specified"));
+ goto cleanup;
+ }
+
if ((cpu->arch != VIR_ARCH_NONE &&
host->arch != cpu->arch) ||
STRNEQ(host->model, cpu->model)) {
if (!(cpu = virCPUDefCopy(legacy)))
goto out;
- if (!(STREQ(cpu->model, "POWER7_v2.1") ||
+ if (!cpu->model ||
+ !(STREQ(cpu->model, "POWER7_v2.1") ||
STREQ(cpu->model, "POWER7_v2.3") ||
STREQ(cpu->model, "POWER7+_v2.1") ||
STREQ(cpu->model, "POWER8_v1.0"))) {
virArch arch;
size_t i;
+ if (!cpu->model) {
+ virReportError(VIR_ERR_INVALID_ARG, "%s",
+ _("no guest CPU model specified"));
+ return VIR_CPU_COMPARE_ERROR;
+ }
+
if (cpu->arch != VIR_ARCH_NONE) {
bool found = false;