mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-02 01:45:17 +00:00
conf: Add support for tpm-spapr to domain XML
This patch adds support for the tpm-spapr device model for ppc64. The XML for this type of TPM looks as follows: <tpm model='tpm-spapr'> <backend type='emulator'/> </tpm> Extend the documentation. Signed-off-by: Stefan Berger <stefanb@linux.vnet.ibm.com> Reviewed-by: Ján Tomko <jtomko@redhat.com> Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
21b6f41d95
commit
914cb83218
@ -8508,10 +8508,13 @@ qemu-kvm -net nic,model=? /dev/null
|
|||||||
<p>
|
<p>
|
||||||
The <code>model</code> attribute specifies what device
|
The <code>model</code> attribute specifies what device
|
||||||
model QEMU provides to the guest. If no model name is provided,
|
model QEMU provides to the guest. If no model name is provided,
|
||||||
<code>tpm-tis</code> will automatically be chosen.
|
<code>tpm-tis</code> will automatically be chosen for non-PPC64
|
||||||
|
architectures.
|
||||||
<span class="since">Since 4.4.0</span>, another available choice
|
<span class="since">Since 4.4.0</span>, another available choice
|
||||||
is the <code>tpm-crb</code>, which should only be used when the
|
is the <code>tpm-crb</code>, which should only be used when the
|
||||||
backend device is a TPM 2.0.
|
backend device is a TPM 2.0. <span class="since">Since 6.1.0</span>,
|
||||||
|
pSeries guests on PPC64 are supported and the default is
|
||||||
|
<code>tpm-spapr</code>.
|
||||||
</p>
|
</p>
|
||||||
</dd>
|
</dd>
|
||||||
<dt><code>backend</code></dt>
|
<dt><code>backend</code></dt>
|
||||||
|
@ -4383,6 +4383,7 @@
|
|||||||
<choice>
|
<choice>
|
||||||
<value>tpm-tis</value>
|
<value>tpm-tis</value>
|
||||||
<value>tpm-crb</value>
|
<value>tpm-crb</value>
|
||||||
|
<value>tpm-spapr</value>
|
||||||
</choice>
|
</choice>
|
||||||
</attribute>
|
</attribute>
|
||||||
</optional>
|
</optional>
|
||||||
@ -4390,6 +4391,9 @@
|
|||||||
<optional>
|
<optional>
|
||||||
<ref name="alias"/>
|
<ref name="alias"/>
|
||||||
</optional>
|
</optional>
|
||||||
|
<optional>
|
||||||
|
<ref name="address"/>
|
||||||
|
</optional>
|
||||||
</element>
|
</element>
|
||||||
</define>
|
</define>
|
||||||
|
|
||||||
|
@ -1128,6 +1128,7 @@ VIR_ENUM_IMPL(virDomainTPMModel,
|
|||||||
"default",
|
"default",
|
||||||
"tpm-tis",
|
"tpm-tis",
|
||||||
"tpm-crb",
|
"tpm-crb",
|
||||||
|
"tpm-spapr",
|
||||||
);
|
);
|
||||||
|
|
||||||
VIR_ENUM_IMPL(virDomainTPMBackend,
|
VIR_ENUM_IMPL(virDomainTPMBackend,
|
||||||
|
@ -1255,6 +1255,7 @@ typedef enum {
|
|||||||
VIR_DOMAIN_TPM_MODEL_DEFAULT,
|
VIR_DOMAIN_TPM_MODEL_DEFAULT,
|
||||||
VIR_DOMAIN_TPM_MODEL_TIS,
|
VIR_DOMAIN_TPM_MODEL_TIS,
|
||||||
VIR_DOMAIN_TPM_MODEL_CRB,
|
VIR_DOMAIN_TPM_MODEL_CRB,
|
||||||
|
VIR_DOMAIN_TPM_MODEL_SPAPR,
|
||||||
|
|
||||||
VIR_DOMAIN_TPM_MODEL_LAST
|
VIR_DOMAIN_TPM_MODEL_LAST
|
||||||
} virDomainTPMModel;
|
} virDomainTPMModel;
|
||||||
|
@ -7760,9 +7760,9 @@ qemuDomainDeviceDefValidateTPM(virDomainTPMDef *tpm,
|
|||||||
|
|
||||||
switch (tpm->version) {
|
switch (tpm->version) {
|
||||||
case VIR_DOMAIN_TPM_VERSION_1_2:
|
case VIR_DOMAIN_TPM_VERSION_1_2:
|
||||||
/* only TIS available for emulator */
|
/* TPM 1.2 + CRB do not work */
|
||||||
if (tpm->type == VIR_DOMAIN_TPM_TYPE_EMULATOR &&
|
if (tpm->type == VIR_DOMAIN_TPM_TYPE_EMULATOR &&
|
||||||
tpm->model != VIR_DOMAIN_TPM_MODEL_TIS) {
|
tpm->model == VIR_DOMAIN_TPM_MODEL_CRB) {
|
||||||
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
|
||||||
_("Unsupported interface %s for TPM 1.2"),
|
_("Unsupported interface %s for TPM 1.2"),
|
||||||
virDomainTPMModelTypeToString(tpm->model));
|
virDomainTPMModelTypeToString(tpm->model));
|
||||||
@ -7797,6 +7797,7 @@ qemuDomainDeviceDefValidateTPM(virDomainTPMDef *tpm,
|
|||||||
case VIR_DOMAIN_TPM_MODEL_CRB:
|
case VIR_DOMAIN_TPM_MODEL_CRB:
|
||||||
flag = QEMU_CAPS_DEVICE_TPM_CRB;
|
flag = QEMU_CAPS_DEVICE_TPM_CRB;
|
||||||
break;
|
break;
|
||||||
|
case VIR_DOMAIN_TPM_MODEL_SPAPR:
|
||||||
case VIR_DOMAIN_TPM_MODEL_LAST:
|
case VIR_DOMAIN_TPM_MODEL_LAST:
|
||||||
default:
|
default:
|
||||||
virReportEnumRangeError(virDomainTPMModel, tpm->model);
|
virReportEnumRangeError(virDomainTPMModel, tpm->model);
|
||||||
@ -9036,10 +9037,16 @@ qemuDomainHostdevDefPostParse(virDomainHostdevDefPtr hostdev,
|
|||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
qemuDomainTPMDefPostParse(virDomainTPMDefPtr tpm)
|
qemuDomainTPMDefPostParse(virDomainTPMDefPtr tpm,
|
||||||
|
virArch arch)
|
||||||
{
|
{
|
||||||
if (tpm->model == VIR_DOMAIN_TPM_MODEL_DEFAULT)
|
if (tpm->model == VIR_DOMAIN_TPM_MODEL_DEFAULT) {
|
||||||
tpm->model = VIR_DOMAIN_TPM_MODEL_TIS;
|
if (ARCH_IS_PPC64(arch))
|
||||||
|
tpm->model = VIR_DOMAIN_TPM_MODEL_SPAPR;
|
||||||
|
else
|
||||||
|
tpm->model = VIR_DOMAIN_TPM_MODEL_TIS;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -9098,7 +9105,7 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_DEVICE_TPM:
|
case VIR_DOMAIN_DEVICE_TPM:
|
||||||
ret = qemuDomainTPMDefPostParse(dev->data.tpm);
|
ret = qemuDomainTPMDefPostParse(dev->data.tpm, def->os.arch);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case VIR_DOMAIN_DEVICE_LEASE:
|
case VIR_DOMAIN_DEVICE_LEASE:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user