From nobody Mon May 6 16:19:04 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1623067306; cv=none; d=zohomail.com; s=zohoarc; b=L3k6lIybqefyAsWUyrvyNVNiW38z+fiFw3tbUPzHbonFXCM+3AXS6oAxmvxrbHNG/iKi1+KUa1WOdCnsVxOtyr7bQVYRBAAaTS+1iNiaxAe6fZZwQtKc8IqiIu+pCcM2Q0vKabI9OJCEeUB2uOUexofgUG/sWDVFvTDX2+5RBY8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623067306; 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=0/deCGrCCt8cMSpEm1OiPtf59FbuIc7sjmybB4TIe4E=; b=NM988d1SaeJD3MNoCIscai3w2eFuMIPhdJwK9kf2WLHwLxgCaj3L+OPoDrUViQCsyhwDjfNSwpv2jcbi6zJ1l9Zayy17IDj+EjRDPnpmiYAsxm3/V3NIjbm6I532dsKP3gWn+rzT8XBrLv+fh3mFKVa3iZ5eXkS4cj+zk4hgvsQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1623067306399558.3323225305998; Mon, 7 Jun 2021 05:01:46 -0700 (PDT) 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-149-VVBPnnOgO-i12LgIpdwnaA-1; Mon, 07 Jun 2021 08:01:41 -0400 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 06AE786ABCE; Mon, 7 Jun 2021 12:01:34 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8BB5C5C1D5; Mon, 7 Jun 2021 12:01:31 +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 E384D4BB40; Mon, 7 Jun 2021 12:01:28 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 157C1RAH022877 for ; Mon, 7 Jun 2021 08:01:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 37C175C22B; Mon, 7 Jun 2021 12:01:27 +0000 (UTC) Received: from work.redhat.com (ovpn-114-106.ams2.redhat.com [10.36.114.106]) by smtp.corp.redhat.com (Postfix) with ESMTP id 800BF5C1D1; Mon, 7 Jun 2021 12:01:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623067304; 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=0/deCGrCCt8cMSpEm1OiPtf59FbuIc7sjmybB4TIe4E=; b=KSLZ7XtnLF5aZzZKxB6iCx0RCqhmhVcDZZPW3txZc0WZa7EnKouXb7tGdiEEaDij58VfGL CG3wHwVVadosEdrVGEIbHTYTNXixRdG3LfW39q1AzXeM0wbEGFu2U8LjGOdpGMGijnNZq4 fLDyq1UIQBi39ppgTFsicrqjMMLHAwM= X-MC-Unique: VVBPnnOgO-i12LgIpdwnaA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 1/2] cpu_map: sync_qemu_i386.py: Use regex to look for begin mark Date: Mon, 7 Jun 2021 14:01:23 +0200 Message-Id: <20210607120124.24535-2-twiederh@redhat.com> In-Reply-To: <20210607120124.24535-1-twiederh@redhat.com> References: <20210607120124.24535-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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" Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/cpu_map/sync_qemu_i386.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/cpu_map/sync_qemu_i386.py b/src/cpu_map/sync_qemu_i386.py index 1a98fa70d7..40c7d6e969 100755 --- a/src/cpu_map/sync_qemu_i386.py +++ b/src/cpu_map/sync_qemu_i386.py @@ -196,7 +196,7 @@ def read_builtin_x86_defs(filename): """Extract content between begin_mark and end_mark from file `filename= ` as string, while expanding shorthand macros like "I486_FEATURES".""" =20 - begin_mark =3D "static X86CPUDefinition builtin_x86_defs[] =3D {\n" + begin_mark =3D re.compile("^static X86CPUDefinition builtin_x86_defs\\= [\\] =3D {$") end_mark =3D "};\n" shorthand =3D re.compile("^#define ([A-Z0-9_]+_FEATURES) (.*)$") lines =3D list() @@ -205,10 +205,11 @@ def read_builtin_x86_defs(filename): with open(filename, "rt") as f: while True: line =3D readline_cont(f) - if line =3D=3D begin_mark: - break if not line: raise RuntimeError("begin mark not found") + match =3D begin_mark.match(line) + if match: + break; match =3D shorthand.match(line) if match: # TCG definitions are irrelevant for cpu models --=20 2.26.3 From nobody Mon May 6 16:19:04 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.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 216.205.24.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=1623067335; cv=none; d=zohomail.com; s=zohoarc; b=k4uWH89XnZInjoRSxSHv+xAX4Vb84pOM5mDyC5O1pQrM2mEDXIBuVxQzaKlvppfJ5JjOPn5uuOGChFnTASKhVVPshEgqXcYVJbOP6U8CL0A1G9bUMeG/ELcVHwcIMDtUPqMUkbiHMY8rxostMaPq12Xvd6DGbEnYZTDADwkHZdg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623067335; 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=cZa5lh7hPK+nyJSbdCug+h5fcjpIaomIojDv8TYXPq4=; b=EqwsfLT9XF6jz+2kgG+r6GeJFHOklLga1afvElDtQipr0xiWVLcN+9ojPvLb+62U2/DPwlw+eS96De/HvZ0q/em0b/PJQP3mUqbE1zv75sSnEOhmw9s2aHfdovk29zdKw2WjxRRfKKvL+oVRjyzE04Q3Pos11OiTZRBsa0UqbYU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.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 [216.205.24.124]) by mx.zohomail.com with SMTPS id 1623067335871481.67347414133314; Mon, 7 Jun 2021 05:02:15 -0700 (PDT) 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-563-WU8TBY7hMAePpVc3sxFvmA-1; Mon, 07 Jun 2021 08:02:12 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 39117803622; Mon, 7 Jun 2021 12:02:06 +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 E271060862; Mon, 7 Jun 2021 12:02:05 +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 72C081801265; Mon, 7 Jun 2021 12:02:05 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 157C1SXB022884 for ; Mon, 7 Jun 2021 08:01:28 -0400 Received: by smtp.corp.redhat.com (Postfix) id 3A1F45C22B; Mon, 7 Jun 2021 12:01:28 +0000 (UTC) Received: from work.redhat.com (ovpn-114-106.ams2.redhat.com [10.36.114.106]) by smtp.corp.redhat.com (Postfix) with ESMTP id 885425C1D1; Mon, 7 Jun 2021 12:01:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623067334; 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=cZa5lh7hPK+nyJSbdCug+h5fcjpIaomIojDv8TYXPq4=; b=KivcGQM24f2/LnDE/XfMCYeqWmLKm8WJnxq6GsEZyttl1NzJmWXh0n1fPlEdHgloSWLnwu qq6wk4TUgSr0oaEDxnP2xX8bMvCmAcgL5gUMi5YdejY5wyYDIfBVH2BBAuMUUrzfoR6IYr TSNl14HmWx9ET7Yw5ppiP1oOuQsXtwc= X-MC-Unique: WU8TBY7hMAePpVc3sxFvmA-1 From: Tim Wiederhake To: libvir-list@redhat.com Subject: [libvirt PATCH 2/2] cpu_map: sync_qemu_i386.py: Allow begin mark to contain `const` Date: Mon, 7 Jun 2021 14:01:24 +0200 Message-Id: <20210607120124.24535-3-twiederh@redhat.com> In-Reply-To: <20210607120124.24535-1-twiederh@redhat.com> References: <20210607120124.24535-1-twiederh@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 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.13 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" This was introduced in qemu commit e11fd68996fb27c040552320f01a7d30a15a7cc1. Signed-off-by: Tim Wiederhake Reviewed-by: Michal Privoznik --- src/cpu_map/sync_qemu_i386.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cpu_map/sync_qemu_i386.py b/src/cpu_map/sync_qemu_i386.py index 40c7d6e969..fbf1edf5d0 100755 --- a/src/cpu_map/sync_qemu_i386.py +++ b/src/cpu_map/sync_qemu_i386.py @@ -196,7 +196,7 @@ def read_builtin_x86_defs(filename): """Extract content between begin_mark and end_mark from file `filename= ` as string, while expanding shorthand macros like "I486_FEATURES".""" =20 - begin_mark =3D re.compile("^static X86CPUDefinition builtin_x86_defs\\= [\\] =3D {$") + begin_mark =3D re.compile("^static( const)? X86CPUDefinition builtin_x= 86_defs\\[\\] =3D {$") end_mark =3D "};\n" shorthand =3D re.compile("^#define ([A-Z0-9_]+_FEATURES) (.*)$") lines =3D list() --=20 2.26.3