From nobody Tue Feb 10 09:24:31 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=fail(p=none dis=none) header.from=bytedance.com ARC-Seal: i=1; a=rsa-sha256; t=1672803013; cv=none; d=zohomail.com; s=zohoarc; b=WJSOAkyoHSNHcw2CPzio+1pPx1idFe5yvhU9B1LfkjviYgtQ2GkAN2MaPjabh5nL5qSnsuhwrsw7WeWoInnZ/lu4jn1cO9qTYDzKmXVUjhSDQiAC4z6invvubYPwJ7eZf8o2OHhX1NRNAuccFI4nveOPjQHN0BCX3e5UAsz9KM4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1672803013; 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=0Inlo5Mo6pOuRoVzFVU+BzKY2wGYbRU9+R2orv0MdHE=; b=BW4FTAV9VjB/c5C9UPeup2yTlBTdCK0y8LnLDKMBNMoS3aerVdvUm1VKx/qoTMcK/PpfkFaSl7ZjFVXxMe3MuRKvfLBHEi6WO7pm4MmkZzdlgFwAsZB7/0rvAFBZgsRF0NehI6d39/KTR9u4TZepE7+eAw4QWz6ozwDeYupgS1Y= 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=fail 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 1672803013447310.0278693332715; Tue, 3 Jan 2023 19:30:13 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-144-rvCXKmiGPB-qvMrVdN_Tag-1; Tue, 03 Jan 2023 22:30:07 -0500 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 42D731C08976; Wed, 4 Jan 2023 03:30:05 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2F767492C18; Wed, 4 Jan 2023 03:30:05 +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 9E97F1947056; Wed, 4 Jan 2023 03:29:55 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id EA9D51947055 for ; Wed, 4 Jan 2023 03:29:53 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id DBE4B2166B2B; Wed, 4 Jan 2023 03:29:53 +0000 (UTC) Received: from mimecast-mx02.redhat.com (mimecast01.extmail.prod.ext.rdu2.redhat.com [10.11.55.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D4BA02166B2A for ; Wed, 4 Jan 2023 03:29:53 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B5857858F09 for ; Wed, 4 Jan 2023 03:29:53 +0000 (UTC) Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-115-CMiX-SKvPOmY-ybiVy2YCA-1; Tue, 03 Jan 2023 22:29:52 -0500 Received: by mail-pf1-f169.google.com with SMTP id z7so16276048pfq.13 for ; Tue, 03 Jan 2023 19:29:51 -0800 (PST) Received: from always-pc.bytedance.net ([61.213.176.6]) by smtp.gmail.com with ESMTPSA id 141-20020a621493000000b005815217e665sm14881863pfu.65.2023.01.03.19.29.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Jan 2023 19:29:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1672803012; h=from:from:sender:sender: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=0Inlo5Mo6pOuRoVzFVU+BzKY2wGYbRU9+R2orv0MdHE=; b=dei7YO6NX+bLxnN+BggEIT+HNEbHTQrH/T3FPV2N1C6zJRgdwAMOcq4rbMKkNMXbGrj3ay lfmqpHASklCMAAEjbmnzC1Yux8ERhuwVbnrdUtLvqmQISBxhWAvo5opE7TYNj6CUQtz48o cI2sZTWO3fDHiIkYLNgbTlT/poF8XxA= X-MC-Unique: rvCXKmiGPB-qvMrVdN_Tag-1 X-Original-To: libvir-list@listman.corp.redhat.com X-MC-Unique: CMiX-SKvPOmY-ybiVy2YCA-1 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0Inlo5Mo6pOuRoVzFVU+BzKY2wGYbRU9+R2orv0MdHE=; b=3T/UifhX1I7vIOiAnM2bbjZEXooxdKYv5CiaPihtO/oC6U8C7Jt6dXpsRPmEQ5yjk6 udWkn4FlC31eXSvKdXX6E7A6ynsR9KUX9w7LKsi28DZ4lA2Eae3G1HnA+MEa7Sl3x8YI E9tNHlnT44GlVsc39cg7BUz8TW/LPESTpORWLA7DLdFYvG7sfY/cqJNqFI8jRIuFtzZ8 Slp1+vojOHrjKpDQjkOjjcVOwbPMRwudZyZReQAaatsTq6njgHvKT75Bf6PchLHUeV9I 4NeVvQsgRkUCuqCnKW76+UFML2Sfvt5NqGB2iZC8VdOi2Ya3VusqPUEeyBwQCppV4v2O 64lA== X-Gm-Message-State: AFqh2kq6GKZG+vPtoWfa7ocFOgzz1f1d7YdsZdoQSupZp8Pu2dAJMOVV OfAyCNP5q1fHYo2wZy5KYE/6SQ== X-Google-Smtp-Source: AMrXdXtNjwBhqNc9j0592ph6jlMqr/KyyiA6gDj8u465GUbRuXfhwHlZ2whTRP8fdqye75XyCele8w== X-Received: by 2002:a62:a21e:0:b0:581:95a7:d2f4 with SMTP id m30-20020a62a21e000000b0058195a7d2f4mr26425094pff.9.1672802991081; Tue, 03 Jan 2023 19:29:51 -0800 (PST) From: zhenwei pi To: mprivozn@redhat.com Subject: [PATCH 3/7] domain_capabilities: define capabilities for crypto Date: Wed, 4 Jan 2023 11:29:33 +0800 Message-Id: <20230104032937.3058144-4-pizhenwei@bytedance.com> In-Reply-To: <20230104032937.3058144-1-pizhenwei@bytedance.com> References: <20230104032937.3058144-1-pizhenwei@bytedance.com> MIME-Version: 1.0 X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection Definition; Similar Internal Domain=false; Similar Monitored External Domain=false; Custom External Domain=false; Mimecast External Domain=false; Newly Observed Domain=false; Internal User Name=false; Custom Display Name List=false; Reply-to Address Mismatch=false; Targeted Threat Dictionary=false; Mimecast Threat Dictionary=false; Custom Threat Dictionary=false X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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: , Cc: libvir-list@redhat.com, helei.sig11@bytedance.com, zhenwei pi Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 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: 1672803015479100003 Content-Type: text/plain; charset="utf-8"; x-default="true" Signed-off-by: zhenwei pi --- src/conf/domain_capabilities.c | 15 +++++++++++++++ src/conf/domain_capabilities.h | 12 ++++++++++++ 2 files changed, 27 insertions(+) diff --git a/src/conf/domain_capabilities.c b/src/conf/domain_capabilities.c index 247cfa49de..aacd590601 100644 --- a/src/conf/domain_capabilities.c +++ b/src/conf/domain_capabilities.c @@ -598,6 +598,20 @@ virDomainCapsDeviceChannelFormat(virBuffer *buf, } =20 =20 +static void +virDomainCapsDeviceCryptoFormat(virBuffer *buf, + const virDomainCapsDeviceCrypto *crypto) +{ + FORMAT_PROLOGUE(crypto); + + ENUM_PROCESS(crypto, model, virDomainCryptoModelTypeToString); + ENUM_PROCESS(crypto, type, virDomainCryptoTypeTypeToString); + ENUM_PROCESS(crypto, backendModel, virDomainCryptoBackendTypeToString); + + FORMAT_EPILOGUE(crypto); +} + + /** * virDomainCapsFeatureGICFormat: * @buf: target buffer @@ -748,6 +762,7 @@ virDomainCapsFormat(const virDomainCaps *caps) virDomainCapsDeviceTPMFormat(&buf, &caps->tpm); virDomainCapsDeviceRedirdevFormat(&buf, &caps->redirdev); virDomainCapsDeviceChannelFormat(&buf, &caps->channel); + virDomainCapsDeviceCryptoFormat(&buf, &caps->crypto); =20 virBufferAdjustIndent(&buf, -2); virBufferAddLit(&buf, "\n"); diff --git a/src/conf/domain_capabilities.h b/src/conf/domain_capabilities.h index 1d504a3506..1b128a3a3c 100644 --- a/src/conf/domain_capabilities.h +++ b/src/conf/domain_capabilities.h @@ -224,6 +224,17 @@ struct _virSGXCapability { virSGXSection *sgxSections; }; =20 +STATIC_ASSERT_ENUM(VIR_DOMAIN_CRYPTO_MODEL_LAST); +STATIC_ASSERT_ENUM(VIR_DOMAIN_CRYPTO_TYPE_LAST); +STATIC_ASSERT_ENUM(VIR_DOMAIN_CRYPTO_BACKEND_LAST); +typedef struct _virDomainCapsDeviceCrypto virDomainCapsDeviceCrypto; +struct _virDomainCapsDeviceCrypto { + virTristateBool supported; + virDomainCapsEnum model; /* virDomainCryptoModel */ + virDomainCapsEnum type; /* virDomainCryptoType */ + virDomainCapsEnum backendModel; /* virDomainCryptoBackend */ +}; + typedef enum { VIR_DOMAIN_CAPS_FEATURE_IOTHREADS =3D 0, VIR_DOMAIN_CAPS_FEATURE_VMCOREINFO, @@ -258,6 +269,7 @@ struct _virDomainCaps { virDomainCapsDeviceTPM tpm; virDomainCapsDeviceRedirdev redirdev; virDomainCapsDeviceChannel channel; + virDomainCapsDeviceCrypto crypto; /* add new domain devices here */ =20 virDomainCapsFeatureGIC gic; --=20 2.34.1