[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 2/8] tests/vm: Do not abuse parallelism when KVM
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-devel] [PATCH v3 2/8] tests/vm: Do not abuse parallelism when KVM is not available |
Date: |
Sat, 13 Oct 2018 02:40:27 +0200 |
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
v3: Use default args.jobs
v2: Add get_default_jobs (Fam suggestion)
---
tests/vm/basevm.py | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py
index 834bc90cc1..2bd32dc6ce 100755
--- a/tests/vm/basevm.py
+++ b/tests/vm/basevm.py
@@ -196,6 +196,13 @@ class BaseVM(object):
return self._guest.qmp(*args, **kwargs)
def parse_args(vm_name):
+
+ def get_default_jobs():
+ if kvm_available():
+ return multiprocessing.cpu_count() / 2
+ else:
+ return 1
+
parser = optparse.OptionParser(
description="VM test utility. Exit codes: "
"0 = success, "
@@ -208,7 +215,7 @@ def parse_args(vm_name):
help="image file name")
parser.add_option("--force", "-f", action="store_true",
help="force build image even if image exists")
- parser.add_option("--jobs", type=int, default=multiprocessing.cpu_count()
/ 2,
+ parser.add_option("--jobs", type=int, default=get_default_jobs(),
help="number of virtual CPUs")
parser.add_option("--verbose", "-V", action="store_true",
help="Pass V=1 to builds within the guest")
--
2.19.1
- [Qemu-devel] [PATCH v3 0/8] tests/vm: Improvements when KVM is not available, Philippe Mathieu-Daudé, 2018/10/12
- [Qemu-devel] [PATCH v3 1/8] tests/vm: Extract the kvm_available() handy function, Philippe Mathieu-Daudé, 2018/10/12
- [Qemu-devel] [PATCH v3 2/8] tests/vm: Do not abuse parallelism when KVM is not available,
Philippe Mathieu-Daudé <=
- [Qemu-devel] [PATCH v3 5/8] tests/vm: Add a BaseVM::arch property, Philippe Mathieu-Daudé, 2018/10/12
- [Qemu-devel] [PATCH v3 3/8] tests/vm: Do not use the -smp option with a single cpu, Philippe Mathieu-Daudé, 2018/10/12
- [Qemu-devel] [PATCH v3 4/8] tests/vm: Display remaining seconds to wait for a VM to start, Philippe Mathieu-Daudé, 2018/10/12
- [Qemu-devel] [PATCH v3 6/8] tests/vm: Let kvm_available() work in cross environments, Philippe Mathieu-Daudé, 2018/10/12
- [Qemu-devel] [PATCH v3 7/8] tests/vm: Do not use -enable-kvm if HOST != TARGET architecture, Philippe Mathieu-Daudé, 2018/10/12
- [Qemu-devel] [PATCH v3 8/8] tests/vm: Do not abuse parallelism when HOST != TARGET architecture, Philippe Mathieu-Daudé, 2018/10/12
- Re: [Qemu-devel] [PATCH v3 0/8] tests/vm: Improvements when KVM is not available, Richard Henderson, 2018/10/15
- Re: [Qemu-devel] [PATCH v3 0/8] tests/vm: Improvements when KVM is not available, Fam Zheng, 2018/10/22