From nobody Thu Nov 6 01:12:40 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1538350754553717.1526615843038; Sun, 30 Sep 2018 16:39:14 -0700 (PDT) Received: from localhost ([::1]:58147 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6lIj-0005OK-CK for importer@patchew.org; Sun, 30 Sep 2018 19:39:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37838) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g6lDK-0008Q9-3U for qemu-devel@nongnu.org; Sun, 30 Sep 2018 19:33:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g6l3h-0001B9-Gc for qemu-devel@nongnu.org; Sun, 30 Sep 2018 19:23:34 -0400 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:37816) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1g6l3h-000199-5N for qemu-devel@nongnu.org; Sun, 30 Sep 2018 19:23:29 -0400 Received: by mail-wr1-x432.google.com with SMTP id u12-v6so11773620wrr.4 for ; Sun, 30 Sep 2018 16:23:22 -0700 (PDT) Received: from x1.local ([80.31.72.241]) by smtp.gmail.com with ESMTPSA id p8sm6984052wrx.9.2018.09.30.16.23.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Sep 2018 16:23:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CAizE9lud0OIVL+pIPWV0kVD8fZVe6zIUA6YgdcIjH8=; b=OgHCFm6sQ0FJrQZAU9U4+V1Z/vgic7VrPAwnwt5e9MNPMRYj2pWCNvi8NJc+4QfC0j 13QIZ1NH35hMdpIAC6hid5ac3wMo02qvSQnuC+8HGjPIkNdbZGvE7yqk0VlQB1MvxbzJ TaHc556nFNgoTDnl5VWtWDO2QnGYlKSBh3yMu6rXwtE+VxffcfDWP0YLSVBP4tJ+PuJC d36Mx+zc7mOCJxe8H9ZJuGnXNG1YbGtu2IPy81Ih38WCEt/4NAeySVPSbtJFpD5JMY/c TpV1LttsGffqisO5evhzSQml40n4J7mtzER+y134mhTeCmrqxgJ3g112iR5LjLzFJedG QK0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=CAizE9lud0OIVL+pIPWV0kVD8fZVe6zIUA6YgdcIjH8=; b=G3PPI/6qbW3nMW91oUV9e5iIsQdSq97C2htOOghjTaax17tufc6291PIWFConLYd2i IhLPDT24yMSTDog8Da1AtxRn7SVaFbECSs1Xwple7UFEkPZTCzTawD39O8JgsRDmqXAX iQ+uoLZ8qQVc2sLWfHli4CnRcQlT1GS478YX4YQ3NajOWGcMYdoB1XLMtnt3OusIGVsZ beV8GRPZC4UJ4BPKkD7jzZ6jJWnxqLJtt6zrwzvJUVN6zDocurNecy9ubJ5mvKGCzJUU eTDxuN4p7W88ikFrikzQoDAl7rxgHkaNY8lwpkRfCPKHEspLi+h/2zJkcjT9tCMDYoBy /ypQ== X-Gm-Message-State: ABuFfogPBIP4Zx1FHd31CNBSbkgvcpf2dfOQmaQTFko45p8//bkKNsSm VFdMnxUZ93s6GWBIMmuSFZ8= X-Google-Smtp-Source: ACcGV6249theapsuvUucCSp5R9x1ZIbblIB6ICR4fwMw4NvzIe4ZRKM8odA8Nf5zLH+d/T1EXcZ0ew== X-Received: by 2002:adf:8141:: with SMTP id 59-v6mr4857825wrm.127.1538349801235; Sun, 30 Sep 2018 16:23:21 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Fam Zheng Date: Mon, 1 Oct 2018 01:23:11 +0200 Message-Id: <20180930232312.16486-3-f4bug@amsat.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180930232312.16486-1-f4bug@amsat.org> References: <20180930232312.16486-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::432 Subject: [Qemu-devel] [PATCH v2 2/3] tests/vm: Do not abuse parallelism when KVM is not available X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- v2: Add get_default_jobs (Fam suggestion) --- tests/vm/basevm.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 5a5fa09752..fc203e9f53 100755 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -202,6 +202,13 @@ class BaseVM(object): return self._guest.qmp(*args, **kwargs) =20 def parse_args(vm_name): + + def get_default_jobs(): + if kvm_available(): + return multiprocessing.cpu_count() / 2 + else: + return 1 + parser =3D optparse.OptionParser( description=3D"VM test utility. Exit codes: " "0 =3D success, " @@ -214,7 +221,7 @@ def parse_args(vm_name): help=3D"image file name") parser.add_option("--force", "-f", action=3D"store_true", help=3D"force build image even if image exists") - parser.add_option("--jobs", type=3Dint, default=3Dmultiprocessing.cpu_= count() / 2, + parser.add_option("--jobs", type=3Dint, default=3Dget_default_jobs(), help=3D"number of virtual CPUs") parser.add_option("--verbose", "-V", action=3D"store_true", help=3D"Pass V=3D1 to builds within the guest") @@ -237,7 +244,7 @@ def main(vmcls): return 1 logging.basicConfig(level=3D(logging.DEBUG if args.debug else logging.WARN)) - vm =3D vmcls(debug=3Dargs.debug, vcpus=3Dargs.jobs) + vm =3D vmcls(debug=3Dargs.debug, vcpus=3Dargs.jobs if kvm_availabl= e() else 0) if args.build_image: if os.path.exists(args.image) and not args.force: sys.stderr.writelines(["Image file exists: %s\n" % args.im= age, @@ -248,7 +255,7 @@ def main(vmcls): vm.add_source_dir(args.build_qemu) cmd =3D [vm.BUILD_SCRIPT.format( configure_opts =3D " ".join(argv), - jobs=3Dargs.jobs, + jobs=3Dargs.jobs if kvm_available() else 1, verbose =3D "V=3D1" if args.verbose else "")] else: cmd =3D argv --=20 2.19.0