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 <clashclanacc2602@gmail.coM>
This commit is contained in:
Mark Hargreaves 2021-04-04 20:57:57 +03:00 committed by Oliver Smith
parent a440556a0a
commit f758812f64
No known key found for this signature in database
GPG Key ID: 5AE7F5513E0885CB
1 changed files with 5 additions and 0 deletions

View File

@ -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 = {}