From patchwork Fri May 26 16:53:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 685931 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp1025303wrt; Fri, 26 May 2023 09:54:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5zy3ShxnbL6OxpHvSP3XbpgQ+Rnujbzccnk1aNyVsxhZWMJqTiAyHulE7/+DT3lR7LHLR2 X-Received: by 2002:ad4:5be2:0:b0:5e9:752:766b with SMTP id k2-20020ad45be2000000b005e90752766bmr2085535qvc.47.1685120073875; Fri, 26 May 2023 09:54:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685120073; cv=none; d=google.com; s=arc-20160816; b=Baf2sElYVpsQzX+1v6psu8V1zp9EfkVlfxMzWCmLrzbot5fxPQEA/TU9oF+fDB9oR4 Fo5sCkbCt0Kpu4XtU6Qr941PgEJwd7M0cK9wUg5xTwzGti8IhFo8P6RaXLpU+qs9Fxlu I+j8qvPs3vrfxSFdHs1Z08ljFQU8TvkIUAevJ3ODJc9PlR5kxlfFkdEPkMNib28TDSVE yNtvoRB4JvJ2YTC3FCZpwHM7yPZjl8UrfXvO1erd+GU7VWrqreMNW8bHwS5IpOXraDia BqRZO5a+30RYl0NUs7ZMf+82EpEEhbeIRZo/ok2pPY5ruJsnc4E2NiOYQsLCdtC0gMR7 eM1w== 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=dadaeGJAraoXdJKWnEyRjK7/UkylBjw/4fB2pIOhIDM=; b=MpjehxOWZKGAOPa0JGF/EUr1/0ejckNI+EEFa+Rs9pPRi9OmI5vEPYnNWocyzJ2ztm 4DipCvcWDBt5VfJUx3KW/nnn1hpOPGWLFhpz/2tS56VFMo6J35lhLiaRxCeuxR81+zmg ObLHbZzn32Tqbhe10IOlkvXLcGSIS62EI2QlnsmNJjVF1tpo99opcLssgsApc4IVgTj9 PFkxdhyZWS4DRf8dZJxA1UkViM9JB1MCtCfgKHYJXFLoJyuLkzklpO+EeHwEIacL44ut UkFJJzN5MOnZm0EriIwVtPd3yeh1rCuuOzjQ+wMW04kuoujtw+/6zqBfKB6tVJyGFU38 7czg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SXVSnS05; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 gy13-20020a056214242d00b0061656d6cb4esi1550521qvb.344.2023.05.26.09.54.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:33 -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=SXVSnS05; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1685120073; 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=dadaeGJAraoXdJKWnEyRjK7/UkylBjw/4fB2pIOhIDM=; b=SXVSnS05UL3yht4VRCpz//BYxG1HRbCg+OmPxNH6/PuqBDWa7CClHkSk7r+xwPCi7Eea0J xfZnE3j81nXX94+kGw4OnDdb6xSxKtHiYSIatpXHjduai062TfMTlVLZFS6jrQuv9sAX+h bHIdUQb7S4mxeRnqAr7iqxXp5CNUd3U= 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-38-h1usxL8zNDK794Ir3d-m_g-1; Fri, 26 May 2023 12:54:26 -0400 X-MC-Unique: h1usxL8zNDK794Ir3d-m_g-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5DF633C17C62; Fri, 26 May 2023 16:54:24 +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 4BF2D40CFD45; Fri, 26 May 2023 16:54:24 +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 2811919465A4; Fri, 26 May 2023 16:54:24 +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-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 10FBE19465A8 for ; Fri, 26 May 2023 16:54:23 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id F293A9D7A; Fri, 26 May 2023 16:54:22 +0000 (UTC) Delivered-To: libvir-list@redhat.com Received: from mimecast-mx02.redhat.com (mimecast10.extmail.prod.ext.rdu2.redhat.com [10.11.55.26]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EB0239E60 for ; Fri, 26 May 2023 16:54:09 +0000 (UTC) Received: from us-smtp-inbound-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 9F0E71C08DC1 for ; Fri, 26 May 2023 16:54:09 +0000 (UTC) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-340-nRc5NZfWOEi7X999n5bNXA-1; Fri, 26 May 2023 12:54:05 -0400 X-MC-Unique: nRc5NZfWOEi7X999n5bNXA-1 Received: by mail-wr1-f43.google.com with SMTP id ffacd0b85a97d-30adb83aa69so487490f8f.2 for ; Fri, 26 May 2023 09:54:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685120044; x=1687712044; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=dadaeGJAraoXdJKWnEyRjK7/UkylBjw/4fB2pIOhIDM=; b=R+Hk2GHoWhOtQlcGA7c+0wlOYrHt+A4cuvfTPDhPVBd7E4kWCwnADpDBpgY+6SpEYE fRIYM//c7Bwzibi1fO3QgbIuJrNRuNiptuh1boijt3fBbdeQqhDkpPzZnxtL/AvsnmEK wW2VZ0vY0nrir8NX8Iul/SfiFfNgFewDVOz+5dmTtmAMRDpPaPh3oioeadjKyXsOcZbm pVFSu8Cre3Nm1zounW/hXqR0MRBHnoeTi6IJ6Vk4deuWWGVLIyvm2RZWgKHPh98bEziP X3UfPOlgWLkB2myVopYyCYh//Kg8vWUFLi1ejYtTHqCcj1E4mkaBeBOs1BCvhGFU2N1Y huQA== X-Gm-Message-State: AC+VfDzHOzsw2xSLHGffAGocRkTW8DclcJgbGwLSJT3Pm1NwJINghcgj GGK6ZAbEQj1Ehv9G5881NawESA== X-Received: by 2002:a5d:4cc2:0:b0:306:36e7:db27 with SMTP id c2-20020a5d4cc2000000b0030636e7db27mr1909674wrt.16.1685120044687; Fri, 26 May 2023 09:54:04 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id z11-20020adff1cb000000b003093a412310sm5657661wro.92.2023.05.26.09.54.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 May 2023 09:54:03 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 4F2A91FFBC; Fri, 26 May 2023 17:54:03 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org, Stefan Hajnoczi Subject: [PATCH v6 04/11] scripts/qapi: document the tool that generated the file Date: Fri, 26 May 2023 17:53:54 +0100 Message-Id: <20230526165401.574474-5-alex.bennee@linaro.org> In-Reply-To: <20230526165401.574474-1-alex.bennee@linaro.org> References: <20230526165401.574474-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 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 , =?utf-8?q?Philippe_Mathieu-Daud?= =?utf-8?q?=C3=A9?= , =?utf-8?q?Alex_Benn=C3=A9e?= , libvir-list@redhat.com, Kyle Evans , Riku Voipio , Richard Henderson , Markus Armbruster , Greg Kurz , Yanan Wang , Marcel Apfelbaum , Michael Roth , Paolo Bonzini , Christian Schoenebeck , Eric Blake , Warner Losh Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: linaro.org 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: <20230524133952.3971948-5-alex.bennee@linaro.org> --- v6 - use Markus' suggestion for prettier wrapping lines - drop un-needed str() --- 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