From patchwork Fri Jan 6 08:28:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 639690 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp665019pvb; Fri, 6 Jan 2023 00:49:27 -0800 (PST) X-Google-Smtp-Source: AMrXdXvT/PkTtoOoewUADl2hZWoHFMDEI/bpf5NKv3Lfbki8lgdeqJiks1dwW//KubBtynKktA2i X-Received: by 2002:ac8:65cc:0:b0:39c:da20:634 with SMTP id t12-20020ac865cc000000b0039cda200634mr86328441qto.62.1672994967677; Fri, 06 Jan 2023 00:49:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672994967; cv=none; d=google.com; s=arc-20160816; b=y2ZOXUjkjgmCVNVGs+m/Dfs62XhB0/0izgMcf76mvsX/Iw+iLN+On8LEyxhc5VwWIu aVbrgr+bf7FksAxEqLTiJwd7xyZ/nmfxi2STyoFq9GEJNRDu0ArF/a7hNoIvxu/QOAv9 VDNT5mmhZZunySSLQQ8HSZLdHF9T6qsV4psiN9dgifJHWw+34BiWqTdRZb+krTiUxOWw UKpQ81K4tb2z4WeS81ECUPLlHPDTGQKXQjelbBLI3bvL+CWxahn6+66Tz4flIRZmVqLM qyBtl5+/lyEfaDkb96C2XcBAURYVFxPhqcCOZxQfu0q/YqQ3ERRwjWPb+x2U2YFuxsAu zRbw== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uOu604Z5UFAJTAsQ53c878BA+fal4cCtG/JMpcQgNcs=; b=vLkgnM1TIi6Te4/RYad10SOr81Y3ruNLcmMOJbOEfbE7gfJrR7PEJrSgzc48BthtBz zhXN/gHc9SJlIWf0laESyg96wz5Fg7OOpvtOtSDBIC8/mDYh+KwRHEGsnjv9EcBIUD3M YMUP7HPP35YCTQ9YQCFoiQZT3wybWMEiJtYFgYTmcDGGp/71Ll1nqSvXPeiEUrtXlT1r s8UjVifns3CGx6TbsmApYkvavm8gAvN81GPagbl+O36RwMcZGTsUgO4TtWpafJ1DsrJB WCBjo0aEicydJ0pR5zVn/4NrvGzwExh4TLDEGwJVdRvX6x9Ff5Ozst7tOBaL2A1oC52+ 66Lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=GY++GEBO; 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=redhat.com Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id d18-20020a05622a15d200b0035cee17b7edsi361016qty.587.2023.01.06.00.49.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 06 Jan 2023 00:49:27 -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=@redhat.com header.s=mimecast20190719 header.b=GY++GEBO; 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=redhat.com Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDi6C-0002ZE-SX; Fri, 06 Jan 2023 03:29:12 -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 1pDi63-0002WD-HD for qemu-devel@nongnu.org; Fri, 06 Jan 2023 03:29:03 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDi62-0005US-1E for qemu-devel@nongnu.org; Fri, 06 Jan 2023 03:29:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672993741; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uOu604Z5UFAJTAsQ53c878BA+fal4cCtG/JMpcQgNcs=; b=GY++GEBOS4ABmlSX9ZeOj9I3RHLgi3yDIMlWrby7rROJ4Nc4i4vEkGchNTvFqdItz+KpRE esV2YtydT93u2kO/C8OZ5BEw1+qL2q5tFNiQ43oLW6f7+nGPGpSdMH1WW4Y+3nk06DcEyG VBd9QmmePtum3ZO7qadIt9bfYkZX2To= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-557-tQfkrrY2O6iXtcoRpeWvuw-1; Fri, 06 Jan 2023 03:29:00 -0500 X-MC-Unique: tQfkrrY2O6iXtcoRpeWvuw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AFE63101A52E; Fri, 6 Jan 2023 08:28:59 +0000 (UTC) Received: from thuth.com (unknown [10.39.192.37]) by smtp.corp.redhat.com (Postfix) with ESMTP id 91492492B06; Fri, 6 Jan 2023 08:28:58 +0000 (UTC) From: Thomas Huth To: Peter Maydell , qemu-devel@nongnu.org Cc: Nikita Ivanov Subject: [PULL 02/15] tests/vm: Update get_default_jobs() to work on non-x86_64 non-KVM hosts Date: Fri, 6 Jan 2023 09:28:40 +0100 Message-Id: <20230106082853.31787-3-thuth@redhat.com> In-Reply-To: <20230106082853.31787-1-thuth@redhat.com> References: <20230106082853.31787-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 Received-SPF: pass client-ip=170.10.129.124; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-124.mimecast.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, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, 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 From: 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é Message-Id: <20221209164743.70836-1-philmd@linaro.org> Reviewed-by: Thomas Huth Signed-off-by: Thomas Huth --- 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,