From nobody Mon Feb 9 12:09:25 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1608049871; cv=none; d=zohomail.com; s=zohoarc; b=H0Nz6YlmRVcBb5J0oQYq3/KXCV9s/cPxKsabZvA2rBkY/0wyae0Cwm+RQHmd1+oVHhW5y2SK3jbm8H1yJjb+gdwUoONuEh6n3dVxgyyNrXvyPg82P98b84PyICAcwzfasOXPQrmPz1f64R4+z2Spqy/C1Pj7PIf1RIqIgSCSwac= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608049871; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=x4wgoOwTH0slBIc6SiVXq/eondXgdvKYbq/wv3eTIRs=; b=BywPbhintjv8xTxBDxelaDOQE4neXT9x3u9V8qYc3CqvJgRi75OO39RYYCZO1B2bEpWClAuwzGHLj5//xl+GlSn2WgSw7AOT5gw36owz9ZNFknS9qv37jsSjc5ebryyOLoq1jBg5r6pAn3RrnyT5AuYxzAgFlN0ps7PznKwa4i8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1608049871848214.02367267414388; Tue, 15 Dec 2020 08:31:11 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-18-UQSgChrCNVa87Vvly9jp0g-1; Tue, 15 Dec 2020 11:25:42 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 17DF21015CAE; Tue, 15 Dec 2020 16:25:30 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E29D737A0; Tue, 15 Dec 2020 16:25:29 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A9B01180954D; Tue, 15 Dec 2020 16:25:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 0BFGPMj2025623 for ; Tue, 15 Dec 2020 11:25:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id A23BD5D9E4; Tue, 15 Dec 2020 16:25:22 +0000 (UTC) Received: from work.redhat.com (ovpn-114-20.ams2.redhat.com [10.36.114.20]) by smtp.corp.redhat.com (Postfix) with ESMTP id CC5D35D9D7; Tue, 15 Dec 2020 16:25:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608049624; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=x4wgoOwTH0slBIc6SiVXq/eondXgdvKYbq/wv3eTIRs=; b=O+zPr0EwUqM7q78DnfGrN2IU6XNKFx737cPBH+/rFuobYnBYGFoVpDTDTYC1IkSpmhLq/x oBV1pbi6YJDanG3VBqk7sLECwQ3sSL7aVYerWTlijoAckbLgUhSwxbB5Co0e9ZFbgCgA36 S9Yp/tLlswrc4RG05IQ4XFBDTkgXqz0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608049866; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=x4wgoOwTH0slBIc6SiVXq/eondXgdvKYbq/wv3eTIRs=; b=VP9F+9rlwE4rR3qzJ0wl8y6dg51/DohySMotaaOzwxvXNardQ2RAvqUwxarshe9WxmlmZZ hATXl/av5DJuCifOYFV2TU+kf4ENCI08lJtsZOrkLY/rhn7X6ggnZDkwHlNrP7IXq8pzNE DGxd5hZnRe/s7Oh8SC14mXyIoEMG0+Y= X-MC-Unique: UQSgChrCNVa87Vvly9jp0g-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 05/29] cpu-gather: Move cpuid call to new script Date: Tue, 15 Dec 2020 17:24:51 +0100 Message-Id: <20201215162515.53742-6-twiederh@redhat.com> In-Reply-To: <20201215162515.53742-1-twiederh@redhat.com> References: <20201215162515.53742-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Tim Wiederhake X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Turn the comment on how to aquire cpuid into a runtime error message. Use "http" instead of "https" in the URL, as the latter is broken. Signed-off-by: Tim Wiederhake --- tests/cputestdata/cpu-gather.py | 25 +++++++++++++++++++++++++ tests/cputestdata/cpu-gather.sh | 7 ------- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/tests/cputestdata/cpu-gather.py b/tests/cputestdata/cpu-gather= .py index 4e8c72e4f4..97655399c8 100755 --- a/tests/cputestdata/cpu-gather.py +++ b/tests/cputestdata/cpu-gather.py @@ -18,6 +18,25 @@ def gather_name(args): "Use '--model' to set a model name.") =20 =20 +def gather_cpuid_leaves(): + try: + output =3D subprocess.check_output( + ["cpuid", "-1r"], + universal_newlines=3DTrue) + except FileNotFoundError as e: + exit("Error: '{}' not found.\n'cpuid' can be usually found in a " + "package named identically. If your distro does not provide s= uch " + "package, you can find the sources or binary packages at " + "'http://www.etallen.com/cpuid.html'.".format(e.filename)) + + for line in output.split("\n"): + if not line: + continue + if line =3D=3D "CPU:": + continue + yield line.strip() + + def main(): parser =3D argparse.ArgumentParser(description=3D"Gather cpu test data= ") parser.add_argument( @@ -30,6 +49,12 @@ def main(): name =3D gather_name(args) print("model name\t: {}".format(name)) =20 + leaves =3D gather_cpuid_leaves() + print("CPU:") + for leave in leaves: + print(" {}".format(leave)) + print() + print(end=3D"", flush=3DTrue) os.environ["CPU_GATHER_PY"] =3D "true" subprocess.check_call("./cpu-gather.sh") diff --git a/tests/cputestdata/cpu-gather.sh b/tests/cputestdata/cpu-gather= .sh index b671f223a5..f84215e777 100755 --- a/tests/cputestdata/cpu-gather.sh +++ b/tests/cputestdata/cpu-gather.sh @@ -1,17 +1,10 @@ #!/bin/bash -# -# The cpuid tool can be usually found in a package called "cpuid". If your -# distro does not provide such package, you can find the sources or binary -# packages at https://www.etallen.com/cpuid.html =20 if [ -z "${CPU_GATHER_PY}" ]; then echo >&2 "Do not call this script directly. Use 'cpu-gather.py' instea= d." exit 1 fi =20 -cpuid -1r -echo - python3 <