From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1mQC23-0008DI-4l for mharc-qemu-riscv@gnu.org; Tue, 14 Sep 2021 13:15:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43444) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQC1x-000891-N2 for qemu-riscv@nongnu.org; Tue, 14 Sep 2021 13:15:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:48410) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mQC1u-0000Uc-LF for qemu-riscv@nongnu.org; Tue, 14 Sep 2021 13:15:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631639733; h=from:from: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; bh=jJ9xWZMiWsz/BwXwvXZIrZr6DPdm4UKto1ksF+WrM54=; b=V+cgSux0MUJazvZtFNstZipVqfwK3qGFPlz0t5YlkyqIyCaJHxTRMDxE7F1m2+ejVxI5fV JV+hDuG8Y81IPoIVkGYFrL2avlIaMtc0f6NAcjxLsXG5y8sqMo8PO3YMuKKCPtXqqxlAH3 d143347qbQ8ibVNhcLcMAIrg2DVX5mM= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-3-V31eemCOMT2LSs7u8fitRA-1; Tue, 14 Sep 2021 13:15:32 -0400 X-MC-Unique: V31eemCOMT2LSs7u8fitRA-1 Received: by mail-wr1-f69.google.com with SMTP id q14-20020a5d574e000000b00157b0978ddeso4216441wrw.5 for ; Tue, 14 Sep 2021 10:15:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=jJ9xWZMiWsz/BwXwvXZIrZr6DPdm4UKto1ksF+WrM54=; b=sZUg0y0/Wi4M/KTIdkvhW0PFERGz2whN+OW6pHb7PIEcV9PP8mqdE+F5Hcut02Gqt/ GJ13OlwJD1bcD4lWXKrzUov484zVnaGqMaioxSWxp+DszsdPFRvYmHG4k7g+J7puKYDk MfB92GXqGWfGZu8kp8YTwaPPSgQ3fwDAsOqlZ7ZXlXlNFXu3Re9JoXiZQfmACQ6bsamN sfvAQM6r4SGoyH9SKd39CizBd9E6hq9tBAA+4ucHBf4f0A++fUWCenNKD2tyr5Lk3i2v AfjJShY4/p2+M2wQmYDOyHHmkN+oeVjcx3WTatNPX9MKnMLwKijQKc4265pHTtcKVNnk ohQg== X-Gm-Message-State: AOAM5312JwjWuAJWYhfm4UWoJV4CeSNe+UuxNxF5+Ajg6FJTIP0wr4It EYHY6a8PrG14RoUrHOD51uXRwNxe5flM9Cn7hF7b62aFUhqDQ00h1MrMC1McSiah9ROZ8Gel/pI Htcu4WgRfg+yVeeY= X-Received: by 2002:adf:fe0e:: with SMTP id n14mr291536wrr.236.1631639731652; Tue, 14 Sep 2021 10:15:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy/Kr/8qQoTmiiiNbyu3jw0TeHX3VQKL48jKzR/XffTD8L8JRg9QzQSCWnqkZnqUzkH+CYqRQ== X-Received: by 2002:adf:fe0e:: with SMTP id n14mr291478wrr.236.1631639731319; Tue, 14 Sep 2021 10:15:31 -0700 (PDT) Received: from [192.168.1.36] (14.red-83-35-25.dynamicip.rima-tde.net. [83.35.25.14]) by smtp.gmail.com with ESMTPSA id j27sm1554808wms.6.2021.09.14.10.15.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Sep 2021 10:15:30 -0700 (PDT) Subject: Re: [PATCH v2 29/53] qapi: introduce x-query-registers QMP command To: Eric Blake , =?UTF-8?Q?Daniel_P=2e_Berrang=c3=a9?= , Markus Armbruster , =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= Cc: Peter Maydell , Chris Wulff , David Hildenbrand , Bin Meng , Mark Cave-Ayland , qemu-devel@nongnu.org, Laurent Vivier , Max Filippov , Taylor Simpson , Alistair Francis , Gerd Hoffmann , "Edgar E. Iglesias" , Marek Vasut , Yoshinori Sato , Halil Pasic , Christian Borntraeger , Palmer Dabbelt , Artyom Tarasenko , Laurent Vivier , Thomas Huth , Eduardo Habkost , Richard Henderson , Greg Kurz , Yuval Shaia , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, Michael Rolnik , Peter Xu , Stafford Horne , David Gibson , qemu-riscv@nongnu.org, Bastian Koppelmann , Cornelia Huck , qemu-ppc@nongnu.org, Aurelien Jarno , Paolo Bonzini , Aleksandar Rikalo , "Dr. David Alan Gilbert" References: <20210914142042.1655100-1-berrange@redhat.com> <20210914142042.1655100-30-berrange@redhat.com> <20210914160416.tmk5nuhch2yhfb27@redhat.com> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Message-ID: Date: Tue, 14 Sep 2021 19:15:28 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210914160416.tmk5nuhch2yhfb27@redhat.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=philmd@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=170.10.129.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -32 X-Spam_score: -3.3 X-Spam_bar: --- X-Spam_report: (-3.3 / 5.0 requ) DKIMWL_WL_HIGH=-0.398, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-1.969, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-riscv@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Sep 2021 17:15:39 -0000 On 9/14/21 6:04 PM, Eric Blake wrote: > On Tue, Sep 14, 2021 at 03:20:18PM +0100, Daniel P. Berrangé wrote: >> This is a counterpart to the HMP "info registers" command. It is being >> added with an "x-" prefix because this QMP command is intended as an >> ad hoc debugging tool and will thus not be modelled in QAPI as fully >> structured data, nor will it have long term guaranteed stability. >> The existing HMP command is rewritten to call the QMP command. >> >> Signed-off-by: Daniel P. Berrangé >> --- >> +## >> +# @HumanReadableText: >> +# >> +# @human-readable-text: Formatted output intended for humans. >> +# >> +# Since: 6.2.0 > > Should be '6.2', not '6.2.0', to match... > >> +# >> +## >> +{ 'struct': 'HumanReadableText', >> + 'data': { 'human-readable-text': 'str' } } >> diff --git a/qapi/machine.json b/qapi/machine.json >> index 157712f006..8737efa865 100644 >> --- a/qapi/machine.json >> +++ b/qapi/machine.json >> @@ -1312,3 +1312,18 @@ >> '*cores': 'int', >> '*threads': 'int', >> '*maxcpus': 'int' } } >> + >> +## >> +# @x-query-registers: >> +# >> +# @cpu: the CPU number to query. If omitted, queries all CPUs >> +# >> +# Query information on the CPU registers >> +# >> +# Returns: CPU state in an architecture-specific format >> +# >> +# Since: 6.2 > > ...the prevailing style. > > If it were likely that someone might backport just some (but not all) > added x- commands, it may be wise to separate the creation of > HumanReadableText into its own patch to backport that but not > x-query-registers. But I rather suspect anyone backporting this will > take the series wholesale, so the coupling in this patch is not worth > worrying about. IIUC the problem is this breaks bisection, as you get a QAPI error: qapi/qapi-commands-machine.c:123:13: error: ‘qmp_marshal_output_HumanReadableText’ defined but not used [-Werror=unused-function] 123 | static void qmp_marshal_output_HumanReadableText(HumanReadableText *ret_in, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors See the comment added in commit 1f7b9f3181e ("qapi/commands: add #if conditions to commands"). > >> +## >> +{ 'command': 'x-query-registers', >> + 'data': {'*cpu': 'int' }, >> + 'returns': 'HumanReadableText' } >> -- >> 2.31.1 >> >