tests/vm: Update get_default_jobs() to work on non-x86_64 non-KVM hosts
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.
--- tests/vm/basevm.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
tests/vm/basevm.py +1 -2
@@ -569,8 +569,7 @@ def get_default_jobs(): # 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,
Signature · 1 line
2.38.1
Thomas Huth
Reviewed-byQuoted 22 lines · Philippe Mathieu-Daudé
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]>--- tests/vm/basevm.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)tests/vm/basevm.py +0
-0
tests/vm/basevm.py def get_default_jobs(): · line 575
Quoted 9 lines
tests/vm/basevm.py +1
-2@@ -569,8 +569,7 @@ def get_default_jobs(): # 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,
John Snow
Reviewed-byQuoted 10 lines · Philippe Mathieu-Daudé
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'
Quoted 4 lines
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]>
Quoted 21 lines
--- tests/vm/basevm.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)tests/vm/basevm.py +1
-3@@ -569,8 +569,7 @@ def get_default_jobs(): # 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, --2.38.1
Quoted 9 lines · Philippe Mathieu-Daudé
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'
Quoted 4 lines
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]>
Queued to testing/next, thanks.
Signature · 2 lines
Alex Bennée Virtualisation Tech Lead @ Linaro