From nobody Sat Feb 7 06:20:39 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@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 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1659080586; cv=none; d=zohomail.com; s=zohoarc; b=eMQwynVBOfvaIvgIW1r5nPsS1lcOg6NYSHPDXFsnFViz4r6z8P7QravCqstsWw0xFIsN4CWaCWnWIvRJwqmiwF4K28/ynwbhqO+Fokw33zZKQYjWD9mm4+FakMDpuKsfgfBzI+Zb3sCrH9VX9JfWhtG/RMoy9l266f1QBcUb3cc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1659080586; h=Content-Type:Content-Transfer-Encoding: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=4gGh+HdfVob7PPyd5h64PwZZ60JLFeOLAKbtH3y73o8=; b=X0QZv/xMhmNp68/uNY1yZAgHhFxQ3LkPzfAi7gmb+Swzuj7Po9rBb+kwM2vUHX2qb4NvKtP5t30kFVrVgGlIw49p3MthNAoy0kamarWl0hvpKUXttipgeEsUl4GHpK8wzo0M+dqXbkodmWpnSXlZE8MmnI3Km7zhfL/4GkFpzd8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 165908058689314.487241604014343; Fri, 29 Jul 2022 00:43:06 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-632-E4FbnDOiNHK15aZIkArIOA-1; Fri, 29 Jul 2022 03:42:20 -0400 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7EA1D85A586; Fri, 29 Jul 2022 07:42:18 +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 6CC6C492CA2; Fri, 29 Jul 2022 07:42:18 +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 2F517193211F; Fri, 29 Jul 2022 07:42:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 33989193211B for ; Fri, 29 Jul 2022 07:42:15 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 2A390492C3B; Fri, 29 Jul 2022 07:42:15 +0000 (UTC) Received: from maggie.redhat.com (unknown [10.43.2.88]) by smtp.corp.redhat.com (Postfix) with ESMTP id CA4A940315E for ; Fri, 29 Jul 2022 07:42:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659080585; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=4gGh+HdfVob7PPyd5h64PwZZ60JLFeOLAKbtH3y73o8=; b=f8bSYprD9jZAjDP5QHzKaGAhYc+2QHjsEpjQNRTmxIXVX1n+2DTrmM0gJYwlCKv+25Jtyh 7DHmdlg7LI/PkLX79eQ92luMowgwJ0+472RuWEVju1gj5YBiL69Yjwm3uBjTaP+z9IxMaT WCDcQknTL/ItsRAPwxQlswf2tNeNtZo= X-MC-Unique: E4FbnDOiNHK15aZIkArIOA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Michal Privoznik To: libvir-list@redhat.com Subject: [PATCH 1/3] virtpm: Use corresponding type for argument for virTPM*CapsGet() Date: Fri, 29 Jul 2022 09:42:11 +0200 Message-Id: <787c7fd4c4936c99737fd4ea4f40d1d9de3e501f.1659080395.git.mprivozn@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 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: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.9 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1659080589052100005 Content-Type: text/plain; charset="utf-8"; x-default="true" In virtpm.h there are two functions exposed for querying swtpm and swtpm_setup capabilieis: virTPMSwtpmCapsGet() and virTPMSwtpmSetupCapsGet(), respectively. The capabilities we are interested in are defined in two separate enums (virTPMSwtpmFeature and virTPMSwtpmSetupFeature), but these functions accept capability as an unsigned int rather than their respective enum. While this makes sense for virTPMBinaryGetCaps(), which is a module internal helper that both exposed functions call, there's no need for the functions themselves to accept unsigned int. Signed-off-by: Michal Privoznik Reviewed-by: Andrea Bolognani --- src/util/virtpm.c | 4 ++-- src/util/virtpm.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/util/virtpm.c b/src/util/virtpm.c index 3c961c11cb..2f2b061fee 100644 --- a/src/util/virtpm.c +++ b/src/util/virtpm.c @@ -345,13 +345,13 @@ virTPMBinaryGetCaps(virTPMBinary binary, } =20 bool -virTPMSwtpmCapsGet(unsigned int cap) +virTPMSwtpmCapsGet(virTPMSwtpmFeature cap) { return virTPMBinaryGetCaps(VIR_TPM_BINARY_SWTPM, cap); } =20 bool -virTPMSwtpmSetupCapsGet(unsigned int cap) +virTPMSwtpmSetupCapsGet(virTPMSwtpmSetupFeature cap) { return virTPMBinaryGetCaps(VIR_TPM_BINARY_SWTPM_SETUP, cap); } diff --git a/src/util/virtpm.h b/src/util/virtpm.h index 89adbdf720..a873881b23 100644 --- a/src/util/virtpm.h +++ b/src/util/virtpm.h @@ -28,9 +28,6 @@ char *virTPMGetSwtpmIoctl(void); =20 bool virTPMHasSwtpm(void); =20 -bool virTPMSwtpmCapsGet(unsigned int cap); -bool virTPMSwtpmSetupCapsGet(unsigned int cap); - typedef enum { VIR_TPM_SWTPM_FEATURE_CMDARG_PWD_FD, =20 @@ -50,3 +47,6 @@ typedef enum { =20 VIR_ENUM_DECL(virTPMSwtpmFeature); VIR_ENUM_DECL(virTPMSwtpmSetupFeature); + +bool virTPMSwtpmCapsGet(virTPMSwtpmFeature cap); +bool virTPMSwtpmSetupCapsGet(virTPMSwtpmSetupFeature cap); --=20 2.35.1