From nobody Wed Apr 24 09:06:44 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623264780; cv=none; d=zohomail.com; s=zohoarc; b=Yt9IoPkpw6SZ53cOaeR58LbBStZg9RS7aaOxiUXz6QQPSjxU35+3VZ7LhHkFydvZKi8E4GCItPH7qPAzxh7ZyVJDLGfUUbxyGxqHXCUfJIRuZljkNER26PdjnBh44xdGmADhSyessWRCgB4a+w+5anXTkvJbsdroDJvgUPAsNr4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623264780; 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=SRUjfCrpDHU2JF+o34JAcoZAdEJF861zOagw4wgCjaLsXfZvB4gCDJ1QlCxrXKt4nb7wn2xL14k5DvwXE6LdeQrnI6i+qEcWvZWhxTbf3XBLa34cAu69WKrZXdktvgoCZbcYBg8lL/wrsXHVmjnyQN0Fa8SJS571wwt20xu1TA8= 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+importer2=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 1623264780266112.93974649263305; Wed, 9 Jun 2021 11:53:00 -0700 (PDT) Received: from localhost ([::1]:40590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lr3Jz-0000TZ-5K for importer2@patchew.org; Wed, 09 Jun 2021 14:52:59 -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+importer2=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+importer2=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 Wed Apr 24 09:06:45 2024 Delivered-To: importer2@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+importer2=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1623264879; cv=none; d=zohomail.com; s=zohoarc; b=fqnvorQ94E36LYYFHzNSGo4InNx3AsjjAS7bwY4N3F1ZoItJpiYmaPCAystdNT1Ke8UXCNQBdNm2PX1u+gOBafXVJiu/hp77p77xInMNj990v+Mjp0s+EuNI6Y6rTY7Xs8Kf/pgVBfdTvscWG0Biux+pARt6gwPwXyNBS6Uk7BA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1623264879; 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=KJ1YTTR/nBbs6rHT6mYAJ1Ya0bPTslGD6b4LhbiYzwc=; b=TSEbZiQ8rnVKH17X3k4SS+Xr1zS2sycWrDsuIAMoEgLvT512ePLDPCzc/rfci/6qxN97/wV8La2/oyPcB5OxJ7z8k1/UmoRZFYNRWMvEFXxu002rSLsQtlg2Nd8AsBYD8stn+jJ5RmwT7sFGx+4mIAzaxikmX8rEnhPYvoLuM6E= 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+importer2=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 1623264879156548.1083005837356; Wed, 9 Jun 2021 11:54:39 -0700 (PDT) Received: from localhost ([::1]:42744 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lr3La-0001wB-4x for importer2@patchew.org; Wed, 09 Jun 2021 14:54:38 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35608) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lr3HH-0006hG-Tw for qemu-devel@nongnu.org; Wed, 09 Jun 2021 14:50:11 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:31678) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lr3HG-00040s-5B for qemu-devel@nongnu.org; Wed, 09 Jun 2021 14:50:11 -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-558-CTFc3GcROdOPTeHl_XiRcQ-1; Wed, 09 Jun 2021 14:50:08 -0400 Received: by mail-wm1-f72.google.com with SMTP id u17-20020a05600c19d1b02901af4c4deac5so2258377wmq.7 for ; Wed, 09 Jun 2021 11:50:08 -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 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=1623264609; 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=a9oAgjg+5iWtaMFAcEVRLIm/rbxkhHdF/xXn6NoO6ADf+MnftPNUBiMgR9ufcCkNS+Zid5 xpTR3eF/calGJiVMPih2y+hbBi1fNIB5qrGa62ZrZYNA4VxQ39lSngla8jmbYlnvVjBuGN G4hKV2xQJWGLiNec6dmblkgHVIJ6Xcc= X-MC-Unique: CTFc3GcROdOPTeHl_XiRcQ-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=EwTHIhDXpfi1o0nBRjmPaUJwHJkreuJk61qtsAJDs6zBCQhwkTFxIJvrGQd/b9SL/n m40UpDBlxzwvzKFDuQNmPVnkevUVm6A76Jd08y4Zp/fB9GZdlqhcPeOP8MSopccXakEW 7KptgKLGwI33IO7NtXndlPemlcUfrFpFbLRM5FEG+e2Jj2n5oJaHSgVPDeW+cZMORkD4 vBj9KBh2x/YTT2Nf6aQjLPNu6l0/olcOMTlP/aW/Qbn30L5A9bRAaZ0hNAZHKdodkU8S o3geA7RqJUb90TOkmqTxRNY8L65ye2GLTYbaHe4+0iJgUOGI0VSf1UW1un3j2JyBBbae CIlg== X-Gm-Message-State: AOAM531POgpwFG9xHzzBxtr4IIsxYj3r+vdE02AoHKAh0UQoFe7GcDg7 ozSaaI91gmp1rfXg6naClpRn9w5rEyHTLk7Hyk9Ch1jnE+e6n8feT6WClgWkEanawlTZXwn4KJB KNiukmzCoXpT8J8/yT0I+F0qjJ+x4hpsksuS20/dh/xkcKZFoD3c25PNhACyv9KM2 X-Received: by 2002:a05:6000:1563:: with SMTP id 3mr1223987wrz.59.1623264606693; 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 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 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+importer2=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" , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Paolo Bonzini , Eric Blake Errors-To: qemu-devel-bounces+importer2=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) 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