Pass the qemu version struct to this function so that in future we can
make decisions here based on the version of qemu.
---
src/appliance-cpu.c | 2 +-
src/guestfs-internal.h | 2 +-
src/launch-direct.c | 3 ++-
src/launch-libvirt.c | 3 ++-
4 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/appliance-cpu.c b/src/appliance-cpu.c
index 6a9fb0d..a7cf1eb 100644
--- a/src/appliance-cpu.c
+++ b/src/appliance-cpu.c
@@ -68,7 +68,7 @@
* =back
*/
const char *
-guestfs_int_get_cpu_model (int kvm)
+guestfs_int_get_cpu_model (int kvm, const struct version *qemu_version)
{
#if defined(__aarch64__)
/* With -M virt, the default -cpu is cortex-a15. Stupid. */
diff --git a/src/guestfs-internal.h b/src/guestfs-internal.h
index 40dad35..6e314ea 100644
--- a/src/guestfs-internal.h
+++ b/src/guestfs-internal.h
@@ -833,7 +833,7 @@ extern const char *guestfs_int_drive_protocol_to_string (enum
drive_protocol pro
extern int guestfs_int_build_appliance (guestfs_h *g, char **kernel, char **initrd, char
**appliance);
/* appliance-cpu.c */
-const char *guestfs_int_get_cpu_model (int kvm);
+const char *guestfs_int_get_cpu_model (int kvm, const struct version *qemu_version);
/* appliance-kcmdline.c */
extern char *guestfs_int_appliance_command_line (guestfs_h *g, const char *appliance_dev,
int flags);
diff --git a/src/launch-direct.c b/src/launch-direct.c
index efedf92..a12fa8b 100644
--- a/src/launch-direct.c
+++ b/src/launch-direct.c
@@ -391,7 +391,8 @@ launch_direct (guestfs_h *g, void *datav, const char *arg)
#endif
!force_tcg ? "kvm:tcg" : "tcg");
- cpu_model = guestfs_int_get_cpu_model (has_kvm && !force_tcg);
+ cpu_model = guestfs_int_get_cpu_model (has_kvm && !force_tcg,
+ &data->qemu_version);
if (cpu_model) {
ADD_CMDLINE ("-cpu");
ADD_CMDLINE (cpu_model);
diff --git a/src/launch-libvirt.c b/src/launch-libvirt.c
index 168bba6..b32efd8 100644
--- a/src/launch-libvirt.c
+++ b/src/launch-libvirt.c
@@ -1139,7 +1139,8 @@ construct_libvirt_xml_cpu (guestfs_h *g,
string_format ("%d", g->memsize);
} end_element ();
- cpu_model = guestfs_int_get_cpu_model (params->data->is_kvm);
+ cpu_model = guestfs_int_get_cpu_model (params->data->is_kvm,
+ ¶ms->data->qemu_version);
if (cpu_model) {
start_element ("cpu") {
if (STREQ (cpu_model, "host")) {
--
2.10.2