[pve-devel] [PATCH qemu-server] Fixup CPU flag query to not use get_basic_machine_info

Stefan Reiter s.reiter at proxmox.com
Wed Jan 15 15:36:54 CET 2020


get_basic_machine_info was removed by commit 045749f2fc.

Use get_host_arch to get the default machine type instead, and
optionally allow to specify architecture as parameter.

Signed-off-by: Stefan Reiter <s.reiter at proxmox.com>
---

@Thomas: The mentioned commit happened after I sent v6, so the patch you merged
would have needed a rebase as well.

 PVE/QemuServer.pm | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index f7d99e3..5835e9a 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3418,9 +3418,12 @@ sub get_command_for_arch($) {
 # since kvm and tcg machines support different flags
 #
 sub query_supported_cpu_flags {
-    my $flags = {};
+    my ($arch) = @_;
 
-    my ($arch, $default_machine) = get_basic_machine_info();
+    $arch //= get_host_arch();
+    my $default_machine = $default_machines->{$arch};
+
+    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
-- 
2.20.1





More information about the pve-devel mailing list