mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-21 19:02:25 +00:00
conf: add TPM devices to domain capabilities
This adds reporting of available TPM models and backends to the domain capabilities schema Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
193436c6a1
commit
fd0aa7879f
@ -195,6 +195,9 @@
|
||||
<optional>
|
||||
<ref name="filesystem"/>
|
||||
</optional>
|
||||
<optional>
|
||||
<ref name="tpm"/>
|
||||
</optional>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
@ -240,6 +243,13 @@
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name="tpm">
|
||||
<element name="tpm">
|
||||
<ref name="supported"/>
|
||||
<ref name="enum"/>
|
||||
</element>
|
||||
</define>
|
||||
|
||||
<define name="features">
|
||||
<element name="features">
|
||||
<optional>
|
||||
|
@ -533,6 +533,19 @@ virDomainCapsDeviceRNGFormat(virBuffer *buf,
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
virDomainCapsDeviceTPMFormat(virBuffer *buf,
|
||||
const virDomainCapsDeviceTPM *tpm)
|
||||
{
|
||||
FORMAT_PROLOGUE(tpm);
|
||||
|
||||
ENUM_PROCESS(tpm, model, virDomainTPMModelTypeToString);
|
||||
ENUM_PROCESS(tpm, backendModel, virDomainTPMBackendTypeToString);
|
||||
|
||||
FORMAT_EPILOGUE(tpm);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
virDomainCapsDeviceFilesystemFormat(virBuffer *buf,
|
||||
const virDomainCapsDeviceFilesystem *filesystem)
|
||||
@ -652,6 +665,7 @@ virDomainCapsFormat(const virDomainCaps *caps)
|
||||
virDomainCapsDeviceHostdevFormat(&buf, &caps->hostdev);
|
||||
virDomainCapsDeviceRNGFormat(&buf, &caps->rng);
|
||||
virDomainCapsDeviceFilesystemFormat(&buf, &caps->filesystem);
|
||||
virDomainCapsDeviceTPMFormat(&buf, &caps->tpm);
|
||||
|
||||
virBufferAdjustIndent(&buf, -2);
|
||||
virBufferAddLit(&buf, "</devices>\n");
|
||||
|
@ -120,6 +120,15 @@ struct _virDomainCapsDeviceRNG {
|
||||
virDomainCapsEnum backendModel; /* virDomainRNGBackend */
|
||||
};
|
||||
|
||||
STATIC_ASSERT_ENUM(VIR_DOMAIN_TPM_MODEL_LAST);
|
||||
STATIC_ASSERT_ENUM(VIR_DOMAIN_TPM_TYPE_LAST);
|
||||
typedef struct _virDomainCapsDeviceTPM virDomainCapsDeviceTPM;
|
||||
struct _virDomainCapsDeviceTPM {
|
||||
virTristateBool supported;
|
||||
virDomainCapsEnum model; /* virDomainTPMModel */
|
||||
virDomainCapsEnum backendModel; /* virDomainTPMBackendType */
|
||||
};
|
||||
|
||||
STATIC_ASSERT_ENUM(VIR_DOMAIN_FS_DRIVER_TYPE_LAST);
|
||||
typedef struct _virDomainCapsDeviceFilesystem virDomainCapsDeviceFilesystem;
|
||||
struct _virDomainCapsDeviceFilesystem {
|
||||
@ -211,6 +220,7 @@ struct _virDomainCaps {
|
||||
virDomainCapsDeviceHostdev hostdev;
|
||||
virDomainCapsDeviceRNG rng;
|
||||
virDomainCapsDeviceFilesystem filesystem;
|
||||
virDomainCapsDeviceTPM tpm;
|
||||
/* add new domain devices here */
|
||||
|
||||
virDomainCapsFeatureGIC gic;
|
||||
|
Loading…
x
Reference in New Issue
Block a user