nmachines = 0;
if (caps->host.cpu &&
+ caps->host.cpu->model &&
qemuCapsGetCPUDefinitions(qemubinCaps, NULL) > 0 &&
!virCapabilitiesAddGuestFeature(guest, "cpuselection", 1, 0))
goto error;
cpu->sockets = nodeinfo.sockets;
cpu->cores = nodeinfo.cores;
cpu->threads = nodeinfo.threads;
+ caps->host.cpu = cpu;
if (!(data = cpuNodeData(arch))
|| cpuDecode(cpu, data, NULL, 0, NULL) < 0)
- goto error;
-
- caps->host.cpu = cpu;
+ goto cleanup;
ret = 0;
int hasSVM;
if (!host ||
+ !host->model ||
(ncpus = qemuCapsGetCPUDefinitions(caps, &cpus)) == 0) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED, "%s",
_("CPU specification not supported by hypervisor"));
if ((flags & VIR_DOMAIN_XML_UPDATE_CPU) &&
def_cpu &&
(def_cpu->mode != VIR_CPU_MODE_CUSTOM || def_cpu->model)) {
- if (!driver->caps || !driver->caps->host.cpu) {
+ if (!driver->caps ||
+ !driver->caps->host.cpu ||
+ !driver->caps->host.cpu->model) {
virReportError(VIR_ERR_OPERATION_FAILED,
"%s", _("cannot get host CPU capabilities"));
goto cleanup;
if (!driver->caps) {
virReportError(VIR_ERR_INTERNAL_ERROR,
"%s", _("cannot get host capabilities"));
- } else if (!driver->caps->host.cpu) {
+ } else if (!driver->caps->host.cpu ||
+ !driver->caps->host.cpu->model) {
VIR_WARN("cannot get host CPU capabilities");
ret = VIR_CPU_COMPARE_INCOMPATIBLE;
} else {