From patchwork Wed May 31 19:48:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 687289 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp1441519wru; Wed, 31 May 2023 12:48:38 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5eip4K+BRrPD+GW/hwb4xMeTj6I25Kg4dElZY7lNmTPdAtBEjtf4q8aGXciwVbWZ+7M18E X-Received: by 2002:a17:907:a42a:b0:96f:912d:7922 with SMTP id sg42-20020a170907a42a00b0096f912d7922mr5727313ejc.53.1685562518150; Wed, 31 May 2023 12:48:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685562518; cv=none; d=google.com; s=arc-20160816; b=0a4rD7NiLmlWX2OF4h2rvXsmmt3fuZLRQmJvLxE4HV9nXdzvzmq/Zggq94yruD7GHi rUEoGPC2pMbk/JXlTsSYHLr0SWG84k8UxrmHOSSTXIaSdGUU/S1SIE4v3oBnJMpucqgB WuBzCl+GOpg6F3IRhYhD65SIQgY+fT7Y1KL00tesN0fAZ4x9/zRg/w4XpBaq6TQnzImj aCxRYo1MNH9cl8mC0UsssvzNp9/hQ9RBM57zZB249nrvLgURDNL8krGgAQ0oTtQxd2ew i1PGwhpX8QJwNYLVu+t0Cs6+/h2syjV7OVFSmQTaZKOGmRUK3SIMESjbCQg5Z6IzukNV yYww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:sender:errors-to:cc:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:mime-version:references:in-reply-to:message-id:date :subject:to:from:delivered-to:delivered-to:dkim-signature; bh=jmwIuqbKSBmYUUYZl+TDEkyLmw0sm6/vkiGhVfu4wao=; b=0HtlIHOWNqEG+2NfQyDk7ilYOhFI10VeyHjPbWnozGBbcqPkPgaZlAyyReN70OQp1Q MypN6rwOzfQwbnX1a4u1WMMpfKt9K+1EyC7dG7XbBBq88d1jgt/eNIl+X+yuQomlVPaP N6piggogTBUOtqj99fK64i2EexyY970ryppKcqWSWFrjxGE4YafhRI+vEe8EgZn2mc+o K2HmVMrxvM2vCPGCtb3WV72QmtwEyEBCq1TSxltuNX8vClnyFICH8s7bcalH2cje6vMy B+4WtHfM+QrQa34O7mDgBGQxmu94OWEhnsgcKd9/paEPU9ClF9UMFK6c9BwMCNF4hFxA EDUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=B63pG8GG; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com. [170.10.133.124]) by mx.google.com with ESMTPS id n12-20020a170906724c00b009591dd6c71esi2641038ejk.896.2023.05.31.12.48.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 May 2023 12:48:38 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=B63pG8GG; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685562517; 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=jmwIuqbKSBmYUUYZl+TDEkyLmw0sm6/vkiGhVfu4wao=; b=B63pG8GGBghuWqsniSjC+Ts7y12PK2pNdrk7mjtCi7zL4z3zHH3bqfJKB2iIsyVQcibBSO zMpx6cm+p0chZYsfmfBKkEWVg2Dd9AkWBUAmKCAHbmAbVdeySTzS+2MXAVTSRCHsv72MQy Vq2A5D9RPKUXKrCtns1K0r+DkkqnSBI= 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-590-FrHrteFiP5-Ndi7v1bZrdw-1; Wed, 31 May 2023 15:48:33 -0400 X-MC-Unique: FrHrteFiP5-Ndi7v1bZrdw-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A04F2800141; Wed, 31 May 2023 19:48:30 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8AA31492B0C; Wed, 31 May 2023 19:48:30 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 6F04819465B3; Wed, 31 May 2023 19:48:30 +0000 (UTC) X-Original-To: libvir-list@listman.corp.redhat.com Delivered-To: libvir-list@listman.corp.redhat.com Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 54A3B19465B7 for ; Wed, 31 May 2023 19:48:29 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 374EDC0448D; Wed, 31 May 2023 19:48:29 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from localhost (unknown [10.39.192.127]) by smtp.corp.redhat.com (Postfix) with ESMTP id 94746C154DB; Wed, 31 May 2023 19:48:28 +0000 (UTC) From: Stefan Hajnoczi To: qemu-devel@nongnu.org Subject: [PULL 04/11] scripts/qapi: document the tool that generated the file Date: Wed, 31 May 2023 15:48:08 -0400 Message-Id: <20230531194815.1508961-5-stefanha@redhat.com> In-Reply-To: <20230531194815.1508961-1-stefanha@redhat.com> References: <20230531194815.1508961-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Marcel Apfelbaum , =?utf-8?q?Philippe_Mathieu-D?= =?utf-8?q?aud=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , libvir-list@redhat.com, Kyle Evans , Riku Voipio , Richard Henderson , Greg Kurz , Markus Armbruster , Yanan Wang , Stefan Hajnoczi , Michael Roth , Paolo Bonzini , Christian Schoenebeck , Eric Blake , Warner Losh , Richard Henderson Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com From: Alex Bennée This makes it a little easier for developers to find where things where being generated. Reviewed-by: Richard Henderson Reviewed-by: Stefan Hajnoczi Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Markus Armbruster Signed-off-by: Alex Bennée Message-id: 20230526165401.574474-5-alex.bennee@linaro.org Message-Id: <20230524133952.3971948-5-alex.bennee@linaro.org> Signed-off-by: Stefan Hajnoczi --- scripts/qapi/gen.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/qapi/gen.py b/scripts/qapi/gen.py index 8f8f784f4a..70bc576a10 100644 --- a/scripts/qapi/gen.py +++ b/scripts/qapi/gen.py @@ -13,6 +13,7 @@ from contextlib import contextmanager import os +import sys import re from typing import ( Dict, @@ -162,7 +163,7 @@ def __init__(self, fname: str, blurb: str, pydoc: str): def _top(self) -> str: return mcgen(''' -/* AUTOMATICALLY GENERATED, DO NOT MODIFY */ +/* AUTOMATICALLY GENERATED by %(tool)s DO NOT MODIFY */ /* %(blurb)s @@ -174,6 +175,7 @@ def _top(self) -> str: */ ''', + tool=os.path.basename(sys.argv[0]), blurb=self._blurb, copyright=self._copyright) def _bottom(self) -> str: @@ -195,7 +197,10 @@ def _bottom(self) -> str: class QAPIGenTrace(QAPIGen): def _top(self) -> str: - return super()._top() + '# AUTOMATICALLY GENERATED, DO NOT MODIFY\n\n' + return (super()._top() + + '# AUTOMATICALLY GENERATED by ' + + os.path.basename(sys.argv[0]) + + ', DO NOT MODIFY\n\n') @contextmanager