[Libguestfs] [PATCH v2v 3/3] -o qemu: Always use -cpu host unless overridden by source hypervisor

Richard W.M. Jones rjones at redhat.com
Wed Feb 15 14:12:05 UTC 2023


As with the prior commit, prefer -cpu host for all guests (except when
we have more information from the source hypervisor).  Although there
is the disadvantage that -cpu host is non-migratable, in practice it
would be very difficult to live migrate a host launched using direct
qemu commands.

Note that after this change, gcaps_arch_min_version is basically an
informational field.  No output uses it, but it will appear in debug
output and there's the possibility we might use it for a future output
mode.
---
 output/output_qemu.ml | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/output/output_qemu.ml b/output/output_qemu.ml
index 491906ebf9..d1028a9cc3 100644
--- a/output/output_qemu.ml
+++ b/output/output_qemu.ml
@@ -175,10 +175,9 @@ module QEMU = struct
 
     arg "-m" (Int64.to_string (source.s_memory /^ 1024L /^ 1024L));
 
-    (match source.s_cpu_model, guestcaps.gcaps_arch_min_version with
-      | None, 0 -> ()
-      | None, _ -> arg "-cpu" "host"
-      | Some model, _ -> arg "-cpu" model
+    (match source.s_cpu_model with
+      | None -> arg "-cpu" "host"
+      | Some model -> arg "-cpu" model
     );
 
     if source.s_vcpu > 1 then (
-- 
2.39.0



More information about the Libguestfs mailing list