From f758812f6485d93dae04a7484714b12e54a1e851 Mon Sep 17 00:00:00 2001 From: Mark Hargreaves Date: Sun, 4 Apr 2021 20:57:57 +0300 Subject: [PATCH] pmbootstrap qemu: fix on systems with more than 8 CPUs (MR 2045) Fix error when CPU count is more than 8 while emulating a non-native platform: qemu-system-aarch64: Number of SMP CPUs requested (12) exceeds max CPUs supported by machine 'mach-virt' (8) Signed-off-by: Mark Hargreaves --- pmb/qemu/run.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pmb/qemu/run.py b/pmb/qemu/run.py index 14f32f11..9cc3aa63 100644 --- a/pmb/qemu/run.py +++ b/pmb/qemu/run.py @@ -99,6 +99,11 @@ def command_qemu(args, arch, img_path, img_path_2nd=None): flavor = pmb.chroot.other.kernel_flavors_installed(args, suffix)[0] ncpus = os.cpu_count() + # QEMU mach-virt's max CPU count is 8, limit it so it will work correctly + # on systems with more than 8 CPUs + if arch != args.arch_native and ncpus > 8: + ncpus = 8 + if args.host_qemu: qemu_bin = which_qemu(args, arch) env = {}