static int
-qemuDomainDefCPUPostParse(virDomainDefPtr def)
+qemuDomainDefCPUPostParse(virDomainDefPtr def,
+ virQEMUCapsPtr qemuCaps)
{
virCPUFeatureDefPtr sveFeature = NULL;
bool sveVectorLengthsProvided = false;
}
}
+ if (qemuCaps &&
+ def->cpu->mode == VIR_CPU_MODE_HOST_PASSTHROUGH &&
+ !def->cpu->migratable) {
+ if (virQEMUCapsGet(qemuCaps, QEMU_CAPS_CPU_MIGRATABLE))
+ def->cpu->migratable = VIR_TRISTATE_SWITCH_ON;
+ else if (ARCH_IS_X86(def->os.arch))
+ def->cpu->migratable = VIR_TRISTATE_SWITCH_OFF;
+ }
+
/* Nothing to be done if only CPU topology is specified. */
if (def->cpu->mode == VIR_CPU_MODE_CUSTOM &&
!def->cpu->model)
if (qemuDomainDefVcpusPostParse(def) < 0)
return -1;
- if (qemuDomainDefCPUPostParse(def) < 0)
+ if (qemuDomainDefCPUPostParse(def, qemuCaps) < 0)
return -1;
if (qemuDomainDefTsegPostParse(def, qemuCaps) < 0)
<apic/>
<vmport state='off'/>
</features>
- <cpu mode='host-passthrough' check='none'/>
+ <cpu mode='host-passthrough' check='none' migratable='on'/>
<clock offset='utc'>
<timer name='rtc' tickpolicy='catchup'/>
<timer name='pit' tickpolicy='delay'/>
<apic/>
<vmport state='off'/>
</features>
- <cpu mode='host-passthrough' check='none'/>
+ <cpu mode='host-passthrough' check='none' migratable='on'/>
<clock offset='utc'>
<timer name='rtc' tickpolicy='catchup'/>
<timer name='pit' tickpolicy='delay'/>
<type arch='x86_64' machine='pc'>hvm</type>
<boot dev='network'/>
</os>
- <cpu mode='host-passthrough' check='none'/>
+ <cpu mode='host-passthrough' check='none' migratable='off'/>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<type arch='x86_64' machine='pc'>hvm</type>
<boot dev='network'/>
</os>
- <cpu mode='host-passthrough' check='none'/>
+ <cpu mode='host-passthrough' check='none' migratable='off'/>
<clock offset='utc'>
<timer name='kvmclock' present='no'/>
</clock>
<type arch='i686' machine='pc'>hvm</type>
<boot dev='hd'/>
</os>
- <cpu mode='host-passthrough' check='none'>
+ <cpu mode='host-passthrough' check='none' migratable='off'>
<feature policy='require' name='abm'/>
<feature policy='force' name='ds'/>
<feature policy='disable' name='invtsc'/>
<hint-dedicated state='on'/>
</kvm>
</features>
- <cpu mode='host-passthrough' check='none'/>
+ <cpu mode='host-passthrough' check='none' migratable='off'/>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>