Note that for ARM, the 'host' model can only be queried when it is
also used on the commandline. This doesn't change the result for x86_64
either.

The mentioned commit for ARM in the FIXME has long been merged in QEMU
as e19afd5667 ("target/arm/monitor: Introduce
qmp_query_cpu_model_expansion").

Signed-off-by: Fiona Ebner <[email protected]>
---
 src/PVE/QemuServer.pm | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/src/PVE/QemuServer.pm b/src/PVE/QemuServer.pm
index 9ab25c49..1b49e9fd 100644
--- a/src/PVE/QemuServer.pm
+++ b/src/PVE/QemuServer.pm
@@ -2945,11 +2945,6 @@ sub query_supported_cpu_flags {
 
     my $flags = {};
 
-    # FIXME: Once this is merged, the code below should work for ARM as well:
-    # https://lists.nongnu.org/archive/html/qemu-devel/2019-06/msg04947.html
-    die "QEMU/KVM cannot detect CPU flags on ARM (aarch64)\n"
-        if $arch eq "aarch64";
-
     my $kvm_supported = defined(kvm_version()) && $arch eq $host_arch;
     my $qemu_cmd = PVE::QemuServer::Helpers::get_command_for_arch($arch);
     my $fakevmid = -1;
@@ -2978,6 +2973,8 @@ sub query_supported_cpu_flags {
 
         if (!$kvm) {
             push @$cmd, '-accel', 'tcg';
+        } else {
+            push @$cmd, '-cpu', 'host';
         }
 
         my $rc = run_command($cmd, noerr => 1, quiet => 0);
-- 
2.47.3



_______________________________________________
pve-devel mailing list
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to