From nobody Mon Feb 9 11:30:07 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=1608049905; cv=none; d=zohomail.com; s=zohoarc; b=UkkDvMCRbckiq/oyNT4Go2kmlsRs6JPNnMgdNY27niZs2q4yAERYLkqrl/BNSOAdg2zV7ER3OV7sAPBTVpYmoaFKYbjTMygzGqcK5rO/OL0a4NboAMP3nKn6S3Ke/szFvSdiPJd4CtEhNR4OLp/AeiMRiRIGVHD6WRqfBXLidCI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608049905; 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=ipFoGqWXvweNCFX5dZcRUxl18INdiWxHcMHmRMWoRnc=; b=ZJVmmXcVrPy7+5HMmPdemAcTiLbcwAIKRM4Vrz3MrK+MqXKvl/2I38DgZ1/iPrUGfT8dXWKRss7Q2j2lUOLsjpGMNWG6QFJxsW3pYWiqENhSXn0h45GZWrf7daw4KCeHNzyelpXzWMak3wjaQ8dTNHRoIuOROI/3hh30Z8vdNBM= 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 1608049905825647.4798315577531; Tue, 15 Dec 2020 08:31:45 -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-246-zsXpNTKFO4iI3hduqoFuiQ-1; Tue, 15 Dec 2020 11:31:40 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id ADEFC6D532; Tue, 15 Dec 2020 16:31:34 +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 591ED17577; Tue, 15 Dec 2020 16:31:34 +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 085181809CA2; Tue, 15 Dec 2020 16:31:34 +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 0BFGPLen025613 for ; Tue, 15 Dec 2020 11:25:21 -0500 Received: by smtp.corp.redhat.com (Postfix) id 71C355D9E8; Tue, 15 Dec 2020 16:25:21 +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 B32DF5D9D7; Tue, 15 Dec 2020 16:25:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608049903; 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=ipFoGqWXvweNCFX5dZcRUxl18INdiWxHcMHmRMWoRnc=; b=bHY+X6spgY8pcWrc+Q/qmS+/YRe6Z4sTT3Gmwfa2Wr7ZwdCmYOzDNjRw1mXgdwixeeIXTX 6e3WMn8MwbEiTZ4LBFpXci20NV36j4vrHislkv2ZubR7ICFs0KprZXCe9lnv6pI0/cpEll CXgMHgk/IEX/yPfr2qV1HlydQcUNMyM= X-MC-Unique: zsXpNTKFO4iI3hduqoFuiQ-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 04/29] cpu-gather: Allow overwriting model name Date: Tue, 15 Dec 2020 17:24:50 +0100 Message-Id: <20201215162515.53742-5-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.16 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) Content-Type: text/plain; charset="utf-8" Some hardware, e.g. exotic platforms or pre-production hardware, may report wrong or random data for the cpu model name. As the name of the created files is derived from that name, this may lead to issues. Signed-off-by: Tim Wiederhake --- tests/cputestdata/cpu-gather.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/tests/cputestdata/cpu-gather.py b/tests/cputestdata/cpu-gather= .py index 1b02df6ec7..4e8c72e4f4 100755 --- a/tests/cputestdata/cpu-gather.py +++ b/tests/cputestdata/cpu-gather.py @@ -1,20 +1,33 @@ #!/usr/bin/env python3 =20 +import argparse import os import subprocess =20 =20 -def gather_name(): +def gather_name(args): + if args.name: + return args.name + with open("/proc/cpuinfo", "rt") as f: for line in f.readlines(): if line.startswith("model name"): return line.split(":", 2)[1].strip() =20 - exit("Error: '/proc/cpuinfo' does not contain a model name.") + exit("Error: '/proc/cpuinfo' does not contain a model name.\n" + "Use '--model' to set a model name.") =20 =20 def main(): - name =3D gather_name() + parser =3D argparse.ArgumentParser(description=3D"Gather cpu test data= ") + parser.add_argument( + "--name", + help=3D"CPU model name. " + "If unset, model name is read from '/proc/cpuinfo'.") + + args =3D parser.parse_args() + + name =3D gather_name(args) print("model name\t: {}".format(name)) =20 print(end=3D"", flush=3DTrue) --=20 2.26.2