mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
appliance: Use -cpu max.
QEMU has a newish feature (from about 2017 / qemu 2.9) called -cpu max
which is supposed to select the best CPU, ideal for libguestfs.
After this change, on x86-64:
KVM TCG
Direct -cpu max -cpu max
(non-libvirt)
Libvirt <cpu mode="host-passthrough"> <cpu mode="host-model">
<model fallback="allow"/> <model fallback="allow"/>
</cpu> </cpu>
Thanks: Daniel Berrangé
This commit is contained in:
@@ -1169,6 +1169,15 @@ construct_libvirt_xml_cpu (guestfs_h *g,
|
||||
attribute ("fallback", "allow");
|
||||
} end_element ();
|
||||
}
|
||||
else if (STREQ (cpu_model, "max")) {
|
||||
if (params->data->is_kvm)
|
||||
attribute ("mode", "host-passthrough");
|
||||
else
|
||||
attribute ("mode", "host-model");
|
||||
start_element ("model") {
|
||||
attribute ("fallback", "allow");
|
||||
} end_element ();
|
||||
}
|
||||
else
|
||||
single_element ("model", cpu_model);
|
||||
} end_element ();
|
||||
|
||||
Reference in New Issue
Block a user