From patchwork Fri Dec 9 16:47:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 632265 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp971157pvb; Fri, 9 Dec 2022 08:48:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf44ssGptRHjTR4CqEJ9txj/c+77F1FLuKez6ErvOvcDv7jgEH56doHPk1s00ld+8iGB6NjU X-Received: by 2002:a05:622a:8c7:b0:3a6:8ece:9f03 with SMTP id i7-20020a05622a08c700b003a68ece9f03mr9771324qte.42.1670604519818; Fri, 09 Dec 2022 08:48:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670604519; cv=none; d=google.com; s=arc-20160816; b=0GD4s8vizlOkJFHlrUj2p97TJt/wkjD3bsYT8bWmIrWYQwtJmOrzgBTa7pq/jZ/pIQ v2ddxI4ey/P6n1KQZ7PmfZUT2RIT7LDHW4kbN40zBUAjkiUxS0kVpKdUKxVK+pO6fVzq DUsIb8VYW5UUonXJpkXa+QM16Gz1yF0HEOcfVfoBVz6WmGumVMcQiTXYpJtAp2ORqHdN kLZNvrZi4hS0eDuQ/dFljBJNLPnv6o+c/+UzBRyqX1H83M12R3MtA86g8XEymwWqn0oY CiCm0IcncqtOdbnddRmdMTwp/hnZBGTqSfF5shfzQAEKk2ktQYcF3LY39ZjbhZSrA1S7 BSRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=KXcnC2HdtbJZG+XR6H67a6m9QATJvma6IbMUc6ov2JA=; b=d2rIumQgo0Q1odAaypTHW1cUjXGsQXLPxp0WCyj66sdY/6IURnA+5T+QzX3HcovsUB zzyOj87TuDlN/3dEZsOcxDzz3Fn37oeRPKUDO7y2pPwfZQHLWYZczPTptnECZj3WZ92/ Fmi1VTFJ6JL35k8WmaWrzD+O43Q//x43VIBjPXltKcfymkCCJy7eHpOn5cpkLUd/qx7j YeoNJXJ8+/pCOqyJcftGsBQnPstccQPo/1SL5A3KVdlORV9io5vDpUVImRREQgv3qCY3 EMJI66XqXqFrGylvkvydOiKr70kiX3Tm8SQpGhEKj+yKLBSi8ouxGEjzFvO7zVxa2Abs H7TQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l6sTpTsL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id hf2-20020a05622a608200b0031ee925f28bsi1028185qtb.150.2022.12.09.08.48.39 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 09 Dec 2022 08:48:39 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=l6sTpTsL; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p3gXY-0003SN-7I; Fri, 09 Dec 2022 11:48:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p3gXP-0003QG-2c for qemu-devel@nongnu.org; Fri, 09 Dec 2022 11:47:58 -0500 Received: from mail-wr1-x42c.google.com ([2a00:1450:4864:20::42c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p3gXL-0007d2-Tz for qemu-devel@nongnu.org; Fri, 09 Dec 2022 11:47:50 -0500 Received: by mail-wr1-x42c.google.com with SMTP id o5so5798914wrm.1 for ; Fri, 09 Dec 2022 08:47:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=KXcnC2HdtbJZG+XR6H67a6m9QATJvma6IbMUc6ov2JA=; b=l6sTpTsLI9DkRuTt3Ef6PBy6ENXU9tNO1gPUfUkdFMLOP2lGilR9eTusT44oQ8juiz BZQjidAqxYErwrGAR/p+b9m/AjF8zobxdzWA3IQXSOJkY7LdFbOI+/8KH7affHee1hMA Mntqf45eMiOROzQkgnfSLZJenxFY3/ZyaQdx9cVEUbNoaDcbjw9KKPVg6YLBHjRBVOOt G/K4kAhYF2aesnEThqTWA0VfDfesY2754Yp//ea85N/pEY2Pf4Bv6NWd2E1sL5q7ti8i VgNSHW1CFbYxwslkBwfw+3+fp9AR1pW4Jh7HzBtNHicG9zpq+aAgwVFLKwBP4tiJC+or H/9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KXcnC2HdtbJZG+XR6H67a6m9QATJvma6IbMUc6ov2JA=; b=NM0NgomD9y/w7m4KMgCvHpDtoCKBk3gXeGuKZP0vfMkAI9AKPCc48Q88IeZe0ic0bz pBd5jJUPx6NdOme26lKE/VIH+posRcBtfBfsU2vCD2p24XI5fkWuSf2sxa4DNCS0xgwO DEj8isrom7M9x2tCktgGiwFZFU98LlwKP8l+6dednFdoaRzct9pRfixTUqh/nC3xuDlp D5wpLvZfjT/h4oNdhorXgRAt8icL/k2woKkGaAlOw0j5JAZZcxjbJRADG4c3UV1j6KFr 0elOJ0G4BTGcKkS+nPyxy9a4t+Hm4U5iRQZoAVEmGSoX/in5FWz97noeaf2ZAJFsyWET NDeg== X-Gm-Message-State: ANoB5pk1+TMna7V8/zTvPBslAkcW/iz+VKu97mLB+L9PQd0eU7NepaQ5 Y7rLDHtz8WQ4bFwQWjqlHVF2+OSI/K5EIENqBg8= X-Received: by 2002:adf:a743:0:b0:242:1c1a:37ec with SMTP id e3-20020adfa743000000b002421c1a37ecmr3665332wrd.17.1670604465914; Fri, 09 Dec 2022 08:47:45 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id d15-20020a5d538f000000b00242442c8ebdsm1776147wrv.111.2022.12.09.08.47.44 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Fri, 09 Dec 2022 08:47:45 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Thomas Huth , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Beraldo Leal , Wainer dos Santos Moschetta , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , John Snow Subject: [PATCH-for-8.0] tests/vm: Update get_default_jobs() to work on non-x86_64 non-KVM hosts Date: Fri, 9 Dec 2022 17:47:43 +0100 Message-Id: <20221209164743.70836-1-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42c; envelope-from=philmd@linaro.org; helo=mail-wr1-x42c.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org 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é Reviewed-by: Thomas Huth Reviewed-by: John Snow --- tests/vm/basevm.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 2276364c42..23229e23d1 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -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,