]> Git Repo - qemu.git/commitdiff
tests/vm: Update get_default_jobs() to work on non-x86_64 non-KVM hosts
authorPhilippe Mathieu-Daudé <[email protected]>
Fri, 9 Dec 2022 16:47:43 +0000 (17:47 +0100)
committerThomas Huth <[email protected]>
Mon, 9 Jan 2023 12:50:13 +0000 (13:50 +0100)
On non-x86_64 host, if KVM is not available we get:

  Traceback (most recent call last):
    File "tests/vm/basevm.py", line 634, in main
      vm = vmcls(args, config=config)
    File "tests/vm/basevm.py", line 104, in __init__
      mem = max(4, args.jobs)
  TypeError: '>' not supported between instances of 'NoneType' and 'int'

Fix by always returning a -- not ideal but safe -- '1' value.

Fixes: b09539444a ("tests/vm: allow us to take advantage of MTTCG")
Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
Message-Id: <20221209164743[email protected]>
Reviewed-by: Thomas Huth <[email protected]>
Signed-off-by: Thomas Huth <[email protected]>
tests/vm/basevm.py

index 2276364c42f4f17ec49fe0a54db096ff5a31d211..23229e23d1617c69b7d007b69648af590cf27128 100644 (file)
@@ -569,8 +569,7 @@ def parse_args(vmcls):
                 # more cores. but only up to a reasonable limit. User
                 # can always override these limits with --jobs.
                 return min(multiprocessing.cpu_count() // 2, 8)
-        else:
-            return 1
+        return 1
 
     parser = argparse.ArgumentParser(
         formatter_class=argparse.ArgumentDefaultsHelpFormatter,
This page took 0.037624 seconds and 4 git commands to generate.