From nobody Mon Feb 9 13:37:59 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