From patchwork Thu Jun 1 15:06:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 687705 Delivered-To: patch@linaro.org Received: by 2002:a5d:4d8a:0:0:0:0:0 with SMTP id b10csp406094wru; Thu, 1 Jun 2023 08:07:12 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6fDsjHDJOLUcsT1vTfcgclZttRZ3N+XM9FHnTw/wMh9/hDDXw7t/sZszeJlc8Qv4cX2aaf X-Received: by 2002:a05:6102:151e:b0:434:c512:99d2 with SMTP id f30-20020a056102151e00b00434c51299d2mr1057928vsv.4.1685632032155; Thu, 01 Jun 2023 08:07:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685632032; cv=none; d=google.com; s=arc-20160816; b=ezI2wtDmlKkBBMW7YrzrQFUwWKWdq30bkhRNzXxRULJbptXLUYLGJfURQQH8CxQVJp oE+nT8q7s2kDe7iSqHAPkDTm8m1qWTCeMRSOorWJVGasFwW9IRD/pNLKePZ66Hzs9Zj0 O1JJh2Sov/T55lJCtpCdeK8QKCiH4/8amG7/IiBDhjOYAcB5HJdq/dLh/8p4/sfYLbKE BBnFLgyqvJhXKnuf1myJrwQY//RLhXBiHYjcwCiyYEnIV9ZmKBotUyDVW4MFcgJm7N6f fee7sEk5Fh44tNXbOavI/x4I38fxtziiEDaAsAglX+KvpDylVSUr+unr4b9qI4r0HO0p JM/g== 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=xYx179ow/LyrTm5aykNplHqEglESJkQgmk6hzc42eOoJQh0oeq2M37+ayJHSDLbO9v Ar1MTTTEQoUMyNw59/mSTQY68JoNwj2b+EHAT9avvZZf5Ynv029vB9lzL0fXEFeeaXAS 1Qeo+8jKLmJ8HvKkKi7M6wTLx+Uh0zfpwpqyZVB+gIUfNsVRPfjqWj92PG+3oH27rdG0 AsH9op0mdODrNm3lwdFU2CtIkC/cmADEul4z3Pl4LX5XzTaCPVdWateXvsYqZqHUDfdC cXzAtRTU6LmbgaWAsxTATpi5vrrAw/2OBacDeM6KjA2EG4ywHmVIAViFcOjTYAX5fiNJ iuFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SzrMfePD; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.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.129.124]) by mx.google.com with ESMTPS id r2-20020a67c302000000b00439684c990csi2002923vsj.602.2023.06.01.08.07.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Jun 2023 08:07:12 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SzrMfePD; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 170.10.129.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=1685632031; 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=SzrMfePDE0FPEj1sBjHECyPkS2Ra/HsnHzXItSdEZEDnMndf+28YnKIIgS5ccgFTzAED4I 74Z72mFD4eAFkcuH1jCu9+SugNT93MlcuinrdZVbocyPl80vJowqs++BYNzu0w+zSlKAg/ puCV3kTF1PE5nvZZvYhgP67CIme+nOw= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-673-_Wm0giB8NtKkO5CkC1Lv2w-1; Thu, 01 Jun 2023 11:07:06 -0400 X-MC-Unique: _Wm0giB8NtKkO5CkC1Lv2w-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CBDA13823A23; Thu, 1 Jun 2023 15:07:02 +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 B7D4FC359E2; Thu, 1 Jun 2023 15:07:02 +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 E077619465A0; Thu, 1 Jun 2023 15:07:01 +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-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 1CB0A19465BA for ; Thu, 1 Jun 2023 15:07:00 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id EDCCF112132C; Thu, 1 Jun 2023 15:06:59 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from localhost (unknown [10.39.194.5]) by smtp.corp.redhat.com (Postfix) with ESMTP id 67608112132D; Thu, 1 Jun 2023 15:06:59 +0000 (UTC) From: Stefan Hajnoczi To: qemu-devel@nongnu.org Subject: [PULL v2 04/11] scripts/qapi: document the tool that generated the file Date: Thu, 1 Jun 2023 11:06:42 -0400 Message-Id: <20230601150649.1591095-5-stefanha@redhat.com> In-Reply-To: <20230601150649.1591095-1-stefanha@redhat.com> References: <20230601150649.1591095-1-stefanha@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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 , Stefan Hajnoczi , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , libvir-list@redhat.com, Michael Roth , Riku Voipio , Christian Schoenebeck , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Kyle Evans , Paolo Bonzini , Richard Henderson , 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.8 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