From: Fam Zheng <famz@redhat.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org
Subject: [Qemu-devel] [PULL 3/9] tests/vm: Do not abuse parallelism when KVM is not available
Date: Fri, 26 Oct 2018 22:15:23 +0800 [thread overview]
Message-ID: <20181026141529.4305-4-famz@redhat.com> (raw)
In-Reply-To: <20181026141529.4305-1-famz@redhat.com>
From: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-Id: <20181013004034.6968-3-f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Fam Zheng <famz@redhat.com>
---
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.17.1
next prev parent reply other threads:[~2018-10-26 14:16 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-26 14:15 [Qemu-devel] [PULL 0/9] Testing patches Fam Zheng
2018-10-26 14:15 ` [Qemu-devel] [PULL 1/9] tests: docker: update test-mingw for GTK+ 2.0 removal Fam Zheng
2018-10-26 14:15 ` [Qemu-devel] [PULL 2/9] tests/vm: Extract the kvm_available() handy function Fam Zheng
2018-10-26 14:15 ` Fam Zheng [this message]
2018-10-26 14:15 ` [Qemu-devel] [PULL 4/9] tests/vm: Do not use the -smp option with a single cpu Fam Zheng
2018-10-26 14:15 ` [Qemu-devel] [PULL 5/9] tests/vm: Display remaining seconds to wait for a VM to start Fam Zheng
2018-10-26 14:15 ` [Qemu-devel] [PULL 6/9] tests/vm: Add a BaseVM::arch property Fam Zheng
2018-10-26 14:15 ` [Qemu-devel] [PULL 7/9] tests/vm: Let kvm_available() work in cross environments Fam Zheng
2018-10-26 14:15 ` [Qemu-devel] [PULL 8/9] tests/vm: Do not use -enable-kvm if HOST != TARGET architecture Fam Zheng
2018-10-26 14:15 ` [Qemu-devel] [PULL 9/9] tests/vm: Do not abuse parallelism when " Fam Zheng
2018-10-29 10:22 ` [Qemu-devel] [PULL 0/9] Testing patches Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181026141529.4305-4-famz@redhat.com \
--to=famz@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).