From patchwork Wed Jun 24 14:04:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 191655 Delivered-To: patch@linaro.org Received: by 2002:a92:1f07:0:0:0:0:0 with SMTP id i7csp625742ile; Wed, 24 Jun 2020 07:06:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEgUqZFAWJupT8M30xfC3fBFrTWHOA1SAmW0EI9OELE3meOVY7iSUkgCcVxPtl4CrU0Lxv X-Received: by 2002:a37:796:: with SMTP id 144mr9335943qkh.84.1593007609907; Wed, 24 Jun 2020 07:06:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593007609; cv=none; d=google.com; s=arc-20160816; b=C5w270faww62LgryVTgbSI/H7why9vPB/qNpmy7FqvTZ2kujeTOEA3vZIGLDw6BYzX J/9AUnK9yhpXZPwasTaZ2t8pqEUM/JpxlsZuI/A8/FU0ja8RmyqLwxC7KueuSWIMuYhN j6av7bRbE1/kzXoXKMte6cFxEVbGwvXsVPjIB0lOWd0n0uEj4tH3Y0/xvzjQHepB3CVk GrR1qqjTK39JerKxk3n7Bdmd3dRYjiG8k85ZVwwJOJ9PXBE3GND9qv3B9lrW5vnGhrne kPoa/5uxF3rujHtlbEggjliMDj+OK6Al2QW8qPgA7D3KVEBjuRvpmoVDWwD1QsR7Bkja h6LA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc: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:to:from :dkim-signature; bh=m1Iumf3YfxuO4NhxteboEtLnibs/CAVIrPHuCmkmoi4=; b=Q4XCnD6m8vEUsW/0GM9b6R4zk6y6Tm/4Lys5GF8x2rv2litWONeLcQyj/KrMBfb1CJ hP7KovTJFYE2p4ZY0QLeyulDkhCpS2tRdblmi7wDvwvH2pvy0woL+qI+uvh4fMNOWZ5w Up76Wl9osPk72GM4dVBRNhrczRJ3EH0HSB3JjrMAeLDB3+bopnIzdhTKoy1gDm6q7Mnd yj7cHGMsHJb6Tn4MiB9+ghelhAtsdGaHAnYEKXMhElc5poeIilBZ4sYnXjDuJabnMg2z 51OhnkOG8Oe/yaGeSjYMHpBbIfTB9Ifx89ITqH9jCqCg9Bkgt1/ETNh0lcBwCUOzjbMM GvZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=kwaweC2b; 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=fail (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 g43si691943qtk.293.2020.06.24.07.06.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Jun 2020 07:06:49 -0700 (PDT) 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=fail header.i=@linaro.org header.s=google header.b=kwaweC2b; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:38964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jo637-0000Za-Bu for patch@linaro.org; Wed, 24 Jun 2020 10:06:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59104) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jo61J-0004oh-Gq for qemu-devel@nongnu.org; Wed, 24 Jun 2020 10:04:57 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:40934) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jo61H-0003UG-JY for qemu-devel@nongnu.org; Wed, 24 Jun 2020 10:04:57 -0400 Received: by mail-wm1-x333.google.com with SMTP id f139so2643732wmf.5 for ; Wed, 24 Jun 2020 07:04:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=m1Iumf3YfxuO4NhxteboEtLnibs/CAVIrPHuCmkmoi4=; b=kwaweC2bZkw1W/fNIuATNlTX6TQouli102mvlVEYK7WwCuHm7tMnRNz3dxHew5Fi4y 5/hg4d7ZmkbEljEPaXS18F0/1q4R7VLoQLGdmnvJiQ6sDyjZJFSRXfk8FR2PcPoR37p1 JamsUyt/3W2nUCtfx1Kv4Srs3393dtkEJBRecsq1yzzMWEGepFxiOdUsl/V4whKBKzgV wG8+9BQ19JJtcb6aGSztQwb6mp6IEOMQ4AWuF7Hkdz8rkiJBbEaAgqrF+exxxmFqx9tV b8FTPDIQ1FF0z/hDJGd9vHBUUhtLCwvFO0KeBibyHTMb+BBfR5ouaCGKjC61YDTe/rFR ZSqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=m1Iumf3YfxuO4NhxteboEtLnibs/CAVIrPHuCmkmoi4=; b=VHl4ObqiK3gwtLG2rEmwk8FuAwfo4q/7GgrC6M4dNGu+lPXkslvzrHHN1X1oVn3Omc vJkDZW4P2VGeReFvhM6+APpC7aa4kpy2NwRGkESYmCNhDPvhYHa+pl2U1pQhaTh6uXRR CfLWDnm4vpFlgpm3W18e+ba2gLDJGb5lMilKJ3O07IMJGIsfSBTvwONKdysFhfCwUu4D PXv8Z4VgvFCybq5zVFCXFOvF6VjdDEW0vNJ/4q9UUoqufH2SonDsGZHRNf3zDAZUZ9rg FM4kneWKzvOqbHG+n0O9PZiDkGe3m7O5hQvSHakX+MCWGXTGmR7PxXWNhQruvaNdchVy Uhvg== X-Gm-Message-State: AOAM530EMRZb3/PTykxN0golaCAiUkf2cG1zsZ7tJUP5hypL7IvDLKz1 0g5ZkuP5vAF3Wo0cxcN9DNBZOHEKuyU= X-Received: by 2002:a1c:1d46:: with SMTP id d67mr31968222wmd.152.1593007491419; Wed, 24 Jun 2020 07:04:51 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id q128sm8069049wma.38.2020.06.24.07.04.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Jun 2020 07:04:47 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 77F151FF8F; Wed, 24 Jun 2020 15:04:46 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Subject: [PATCH v2 03/25] tests/vm: pass args through to BaseVM's __init__ Date: Wed, 24 Jun 2020 15:04:24 +0100 Message-Id: <20200624140446.15380-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200624140446.15380-1-alex.bennee@linaro.org> References: <20200624140446.15380-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x333.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. 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, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fam@euphon.net, berrange@redhat.com, Robert Foley , =?utf-8?q?Alex_Benn=C3=A9e?= , richard.henderson@linaro.org, f4bug@amsat.org, =?utf-8?q?Philippe_Mat?= =?utf-8?q?hieu-Daud=C3=A9?= , cota@braap.org, aurelien@aurel32.net Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Robert Foley Adding the args parameter to BaseVM's __init__. We will shortly need to pass more parameters to the class so let's just pass args rather than growing the parameter list. Signed-off-by: Robert Foley Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Signed-off-by: Alex Bennée Message-Id: <20200601211421.1277-2-robert.foley@linaro.org> --- tests/vm/basevm.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) -- 2.20.1 diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index a80b616a08d..5a58e6c3930 100644 --- a/tests/vm/basevm.py +++ b/tests/vm/basevm.py @@ -61,11 +61,10 @@ class BaseVM(object): # 4 is arbitrary, but greater than 2, # since we found we need to wait more than twice as long. tcg_ssh_timeout_multiplier = 4 - def __init__(self, debug=False, vcpus=None, genisoimage=None, - build_path=None): + def __init__(self, args): self._guest = None - self._genisoimage = genisoimage - self._build_path = build_path + self._genisoimage = args.genisoimage + self._build_path = args.build_path self._tmpdir = os.path.realpath(tempfile.mkdtemp(prefix="vm-test-", suffix=".tmp", dir=".")) @@ -78,7 +77,7 @@ class BaseVM(object): self._ssh_pub_key_file = os.path.join(self._tmpdir, "id_rsa.pub") open(self._ssh_pub_key_file, "w").write(SSH_PUB_KEY) - self.debug = debug + self.debug = args.debug self._stderr = sys.stderr self._devnull = open(os.devnull, "w") if self.debug: @@ -92,8 +91,8 @@ class BaseVM(object): (",ipv6=no" if not self.ipv6 else ""), "-device", "virtio-net-pci,netdev=vnet", "-vnc", "127.0.0.1:0,to=20"] - if vcpus and vcpus > 1: - self._args += ["-smp", "%d" % vcpus] + if args.jobs and args.jobs > 1: + self._args += ["-smp", "%d" % args.jobs] if kvm_available(self.arch): self._args += ["-enable-kvm"] else: @@ -456,8 +455,7 @@ def main(vmcls): return 1 logging.basicConfig(level=(logging.DEBUG if args.debug else logging.WARN)) - vm = vmcls(debug=args.debug, vcpus=args.jobs, - genisoimage=args.genisoimage, build_path=args.build_path) + vm = vmcls(args) if args.build_image: if os.path.exists(args.image) and not args.force: sys.stderr.writelines(["Image file exists: %s\n" % args.image,