From nobody Sun Feb 8 23:41:13 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623264757; cv=none; d=zohomail.com; s=zohoarc; b=WRhb0I6S8CRsAtEQphEBz5QwOrCbPuwZRrBnBNjBXhZDSczdpvkgC9FZaDtBHoz9HvGFGZudDPvhQgUi0c1aoFHCF+gfKAHhNWSsYbbn8+eBSzZcs+L7uuAs6gg/gSLqQwk6iQcRuKMiBnTyV+JgliyN7wS/J5Bn4lh7hMyS6m0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623264757; 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=Ufd/1lPD7YOqAcMseEx+0LfzPXOJh9I7gpZPHh9YQsc=; b=M/JY7PWgj9J4NIc5RbSJi8g1VJEiuXaYk7pl+XrewA8d59wZtfFY1FWIEsSlfeiinzXkWNXTvAhrUmR4re/yuBrHolq+v8N+OkVapfoMIaoq9JsCaCLsNwHVOK/8Ry7t5jpnDpbrE1HhKvYvyKqUDfNIXrlhFOF111WqE+WJcUc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1623264757290620.5483196210814; Wed, 9 Jun 2021 11:52:37 -0700 (PDT) Received: from localhost ([::1]:40590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lr3Jc-0000TZ-4c for importer@patchew.org; Wed, 09 Jun 2021 14:52:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35582) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lr3HE-0006bW-Sh for qemu-devel@nongnu.org; Wed, 09 Jun 2021 14:50:08 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:32384) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lr3HD-0003yf-3c for qemu-devel@nongnu.org; Wed, 09 Jun 2021 14:50:08 -0400 Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-212-oNa_TXk1ON2Qnst5ZdF95w-1; Wed, 09 Jun 2021 14:50:03 -0400 Received: by mail-wm1-f72.google.com with SMTP id z25-20020a1c4c190000b029019f15b0657dso2253395wmf.8 for ; Wed, 09 Jun 2021 11:50:03 -0700 (PDT) Received: from x1w.redhat.com (235.red-83-57-168.dynamicip.rima-tde.net. [83.57.168.235]) by smtp.gmail.com with ESMTPSA id m3sm845765wrr.32.2021.06.09.11.50.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Jun 2021 11:50:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623264604; 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=Ufd/1lPD7YOqAcMseEx+0LfzPXOJh9I7gpZPHh9YQsc=; b=YcEExidKLcn7u+KuYA9HIvf58sEeExRDyAdXkzngqTfECp9CvqNEvXD5FbfsWAj02Up995 Mdk9TQavc2Kg3mKwFw6XE4vGlScRPocnz4nykSLAJQo4AN164q/zftCONRMI5knY0XlHS3 KpoqKRMMwVdBQAN4fe8gc8Dz+proHTc= X-MC-Unique: oNa_TXk1ON2Qnst5ZdF95w-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ufd/1lPD7YOqAcMseEx+0LfzPXOJh9I7gpZPHh9YQsc=; b=XN+VezvJ2NSAly+rGcsqT3auzPbbUSKxMAIdX0Hm6bvGQsmInW4XCB/qRqWpMZr9ip Mrm5L/asIvHYMSsxK2PVJ/i8RDh8v1beLD2ZKUAmuIVpVm4hj/xoeqjA1nA+wBBGyNL7 oboNu4X8KIpT1CRihZ4jZDagwsyuFDmKhYGbQpkKe/ti16yFSj8aNlnxgXpY526BZGD0 sTwmfQI4sxhXoUXohC+gkl31qFzj7FN4sdCpoi+wN0bkuyIcJpvCYdtdsMKHQsn4klpj VDBCcus8iAMd2oectxAMSdLhEF8eoA29saGG7VwzPQtZs2fo3G5x9iHjIZpmt8ft5RfZ GUGA== X-Gm-Message-State: AOAM530ewWhXGIoYZZitUtWU8piZymRHqzIrIIp7G+nTuBuwH93m/p98 YpqCFkeTzuWDz/t7EZuENnp4/o7RqVz/zhLLAl50gmtBcp75/ljykCewq5Lz+UT2WzYO/pabdRz FrEVRr+ATB8inlujpDZRl1TLAqLrS7FDgABiT1cNWM/+WOEAPOxLqR8jbPLUrZJCA X-Received: by 2002:adf:b34a:: with SMTP id k10mr1222828wrd.333.1623264602035; Wed, 09 Jun 2021 11:50:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLuyOkhg20CpnP3cdYDjPzDdkGeqHV3SZTlHb/Ol1c14w5oTpGa/bI+Vpw9FmlXfTAmKBNZg== X-Received: by 2002:adf:b34a:: with SMTP id k10mr1222806wrd.333.1623264601849; Wed, 09 Jun 2021 11:50:01 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Subject: [RFC PATCH v2 1/2] qapi: Inline qmp_marshal_output() functions Date: Wed, 9 Jun 2021 20:49:54 +0200 Message-Id: <20210609184955.1193081-2-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210609184955.1193081-1-philmd@redhat.com> References: <20210609184955.1193081-1-philmd@redhat.com> MIME-Version: 1.0 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-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=philmd@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.199, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefan Berger , Michael Roth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Markus Armbruster , "Dr. David Alan Gilbert" , Paolo Bonzini , Eric Blake Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) In case we need to use QAPI types but no QAPI command / QAPI event actually use them, the generated qmp_marshal_output() function will trigger the compiler 'unused-function' warnings. To prevent that, emit these functions inlined: the compiler will ignore such unused functions. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- RFC: No clue about QAPI... Tested with GCC. If the compiler is picky we could use the 'unused' function attribute. --- scripts/qapi/commands.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/qapi/commands.py b/scripts/qapi/commands.py index 0e13d510547..bbed776a909 100644 --- a/scripts/qapi/commands.py +++ b/scripts/qapi/commands.py @@ -91,8 +91,8 @@ def gen_call(name: str, def gen_marshal_output(ret_type: QAPISchemaType) -> str: return mcgen(''' =20 -static void qmp_marshal_output_%(c_name)s(%(c_type)s ret_in, - QObject **ret_out, Error **errp) +static inline void qmp_marshal_output_%(c_name)s(%(c_type)s ret_in, + QObject **ret_out, Error **errp) { Visitor *v; =20 --=20 2.31.1 From nobody Sun Feb 8 23:41:13 2026 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=philmd@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=philmd@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623264609; cv=none; d=zohomail.com; s=zohoarc; b=i/NYv+oINvONYnRwPobyugtFOU90HYA2mFZTm70vEkp1hHdIYER9jkoRIHrT8U+bngJqEc83Q6jAvSqsd3MvtLgWjKwHxCCnug3QVB+H1SXn7OBKB8Oo++MGIFltVPko+DOegx8wMVDrrbSxqjHX/F06x4YLNwdFCubekZBrk6A= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623264609; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=KJ1YTTR/nBbs6rHT6mYAJ1Ya0bPTslGD6b4LhbiYzwc=; b=TO7rbIoZthURu+i80c8DfKVEOmPO2t7siDAH0HyngP2Mt1Pw8AjQvIjnoAxiLEv9Lfb8hLYw35zyL28IsYAF1GCFet1TD96YpC7U2fShE9QsWoxtGdtaxtdo67Ctvx+nNfSY4WgZvcsZpBOT4AOnS2/5cktO0J6Hn1MAeKwE+1E= 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=philmd@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= 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 1623264609803123.17024221279223; Wed, 9 Jun 2021 11:50:09 -0700 (PDT) Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-593-uGrDJq1sOMS0LaADyofpyg-1; Wed, 09 Jun 2021 14:50:07 -0400 Received: by mail-wm1-f72.google.com with SMTP id u17-20020a05600c19d1b02901af4c4deac5so2258354wmq.7 for ; Wed, 09 Jun 2021 11:50:07 -0700 (PDT) Return-Path: Return-Path: Received: from x1w.redhat.com (235.red-83-57-168.dynamicip.rima-tde.net. [83.57.168.235]) by smtp.gmail.com with ESMTPSA id f18sm643774wmj.13.2021.06.09.11.50.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Jun 2021 11:50:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623264608; 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=KJ1YTTR/nBbs6rHT6mYAJ1Ya0bPTslGD6b4LhbiYzwc=; b=UIdno/qjEt41QMNFP44TOHh0MgYuAxpFwWZocnRmhtwjH9oBl2P4XF91BkRLZvHmVUv/8e SvCb7Rwgvy8aXP1n02rENABoKS1owuSR9KH//kwSsgj6gckjkPPihk0z0lU8NB9tZqtRBZ j5Ay2B4+wToI/YQplEbuO7B3BN38ezs= X-MC-Unique: uGrDJq1sOMS0LaADyofpyg-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=KJ1YTTR/nBbs6rHT6mYAJ1Ya0bPTslGD6b4LhbiYzwc=; b=EtWeYf3+Z1VZVMkdtUBzLqbO3z84X3aIXFW/V3QSRneiRS1mASiRt8MIZqeJ1hF7bj rvuu9CdRCyhR6mTjpuIjkFbasrgtj3VoT8IoDWte4dJd8sI88EbcSeOkRvzjc1Z1+F08 yolXTF2fzOnuLLOPOXHbp4W9GBE0lGhjZlH5yP6jiXaMSt6x/vnn2jamQlBlAJMeLvuH 14TLGjWZexZpo0nDOIswHYTmagurgDteJDiC1Sy9+4NaJzU+P7mAIloG0pe5H+koGTk+ xaCUlyCSlMGVJnO59EjNl7jKHTRuhLGPM9TSJ6nS9WNwAJic5zp1Dr73hvZkF6PLdrKZ Hs+A== X-Gm-Message-State: AOAM532OC4YLW+73bjoopTdgvpu4EHk6JylocPhfztlGR3a8avYmtAgA L0dBVEv1EYC+1Q+ko4WGxkNcYh+I0nQA+u1zO3fk862EUiE2cKrDeSirhxXBpRHM5gJXa67c42B BPwh4LgJ3n/lnYA== X-Received: by 2002:a05:6000:1563:: with SMTP id 3mr1223975wrz.59.1623264606577; Wed, 09 Jun 2021 11:50:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwMcdliCeI9K1BsfuD2A0zwV3f2hdz5PD2A41FQIZOeqMBevK4CGq8hES5fOvTTkmuGTsB9Zw== X-Received: by 2002:a05:6000:1563:: with SMTP id 3mr1223961wrz.59.1623264606452; Wed, 09 Jun 2021 11:50:06 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Eric Blake , Markus Armbruster , Michael Roth , "Dr. David Alan Gilbert" , Stefan Berger , Paolo Bonzini , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Subject: [PATCH v2 2/2] tpm: Return QMP error when TPM is disabled in build Date: Wed, 9 Jun 2021 20:49:55 +0200 Message-Id: <20210609184955.1193081-3-philmd@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210609184955.1193081-1-philmd@redhat.com> References: <20210609184955.1193081-1-philmd@redhat.com> MIME-Version: 1.0 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-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) When the management layer queries a binary built using --disable-tpm for TPM devices, it gets confused by getting empty responses: { "execute": "query-tpm" } { "return": [ ] } { "execute": "query-tpm-types" } { "return": [ ] } { "execute": "query-tpm-models" } { "return": [ ] } To make it clearer by returning an error: - Make the TPM QAPI schema conditional - Adapt the HMP command - Remove stubs which became unnecessary The management layer now gets a 'CommandNotFound' error: { "execute": "query-tpm" } { "error": { "class": "CommandNotFound", "desc": "The command query-tpm has not been found" } } Suggested-by: Marc-Andr=C3=A9 Lureau Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Eric Blake