mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-07-11 12:25:52 +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>
|
<optional>
|
||||||
<ref name="filesystem"/>
|
<ref name="filesystem"/>
|
||||||
</optional>
|
</optional>
|
||||||
|
<optional>
|
||||||
|
<ref name="tpm"/>
|
||||||
|
</optional>
|
||||||
</element>
|
</element>
|
||||||
</define>
|
</define>
|
||||||
|
|
||||||
@ -240,6 +243,13 @@
|
|||||||
</element>
|
</element>
|
||||||
</define>
|
</define>
|
||||||
|
|
||||||
|
<define name="tpm">
|
||||||
|
<element name="tpm">
|
||||||
|
<ref name="supported"/>
|
||||||
|
<ref name="enum"/>
|
||||||
|
</element>
|
||||||
|
</define>
|
||||||
|
|
||||||
<define name="features">
|
<define name="features">
|
||||||
<element name="features">
|
<element name="features">
|
||||||
<optional>
|
<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
|
static void
|
||||||
virDomainCapsDeviceFilesystemFormat(virBuffer *buf,
|
virDomainCapsDeviceFilesystemFormat(virBuffer *buf,
|
||||||
const virDomainCapsDeviceFilesystem *filesystem)
|
const virDomainCapsDeviceFilesystem *filesystem)
|
||||||
@ -652,6 +665,7 @@ virDomainCapsFormat(const virDomainCaps *caps)
|
|||||||
virDomainCapsDeviceHostdevFormat(&buf, &caps->hostdev);
|
virDomainCapsDeviceHostdevFormat(&buf, &caps->hostdev);
|
||||||
virDomainCapsDeviceRNGFormat(&buf, &caps->rng);
|
virDomainCapsDeviceRNGFormat(&buf, &caps->rng);
|
||||||
virDomainCapsDeviceFilesystemFormat(&buf, &caps->filesystem);
|
virDomainCapsDeviceFilesystemFormat(&buf, &caps->filesystem);
|
||||||
|
virDomainCapsDeviceTPMFormat(&buf, &caps->tpm);
|
||||||
|
|
||||||
virBufferAdjustIndent(&buf, -2);
|
virBufferAdjustIndent(&buf, -2);
|
||||||
virBufferAddLit(&buf, "</devices>\n");
|
virBufferAddLit(&buf, "</devices>\n");
|
||||||
|
@ -120,6 +120,15 @@ struct _virDomainCapsDeviceRNG {
|
|||||||
virDomainCapsEnum backendModel; /* virDomainRNGBackend */
|
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);
|
STATIC_ASSERT_ENUM(VIR_DOMAIN_FS_DRIVER_TYPE_LAST);
|
||||||
typedef struct _virDomainCapsDeviceFilesystem virDomainCapsDeviceFilesystem;
|
typedef struct _virDomainCapsDeviceFilesystem virDomainCapsDeviceFilesystem;
|
||||||
struct _virDomainCapsDeviceFilesystem {
|
struct _virDomainCapsDeviceFilesystem {
|
||||||
@ -211,6 +220,7 @@ struct _virDomainCaps {
|
|||||||
virDomainCapsDeviceHostdev hostdev;
|
virDomainCapsDeviceHostdev hostdev;
|
||||||
virDomainCapsDeviceRNG rng;
|
virDomainCapsDeviceRNG rng;
|
||||||
virDomainCapsDeviceFilesystem filesystem;
|
virDomainCapsDeviceFilesystem filesystem;
|
||||||
|
virDomainCapsDeviceTPM tpm;
|
||||||
/* add new domain devices here */
|
/* add new domain devices here */
|
||||||
|
|
||||||
virDomainCapsFeatureGIC gic;
|
virDomainCapsFeatureGIC gic;
|
||||||
|
Loading…
Reference in New Issue
Block a user