提交 914cb832 编写于 作者: S Stefan Berger 提交者: Ján Tomko

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: NStefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
Signed-off-by: NJán Tomko <jtomko@redhat.com>
上级 21b6f41d
......@@ -8508,10 +8508,13 @@ qemu-kvm -net nic,model=? /dev/null
<p>
The <code>model</code> attribute specifies what device
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
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>
</dd>
<dt><code>backend</code></dt>
......
......@@ -4383,6 +4383,7 @@
<choice>
<value>tpm-tis</value>
<value>tpm-crb</value>
<value>tpm-spapr</value>
</choice>
</attribute>
</optional>
......@@ -4390,6 +4391,9 @@
<optional>
<ref name="alias"/>
</optional>
<optional>
<ref name="address"/>
</optional>
</element>
</define>
......
......@@ -1128,6 +1128,7 @@ VIR_ENUM_IMPL(virDomainTPMModel,
"default",
"tpm-tis",
"tpm-crb",
"tpm-spapr",
);
VIR_ENUM_IMPL(virDomainTPMBackend,
......
......@@ -1255,6 +1255,7 @@ typedef enum {
VIR_DOMAIN_TPM_MODEL_DEFAULT,
VIR_DOMAIN_TPM_MODEL_TIS,
VIR_DOMAIN_TPM_MODEL_CRB,
VIR_DOMAIN_TPM_MODEL_SPAPR,
VIR_DOMAIN_TPM_MODEL_LAST
} virDomainTPMModel;
......
......@@ -7760,9 +7760,9 @@ qemuDomainDeviceDefValidateTPM(virDomainTPMDef *tpm,
switch (tpm->version) {
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 &&
tpm->model != VIR_DOMAIN_TPM_MODEL_TIS) {
tpm->model == VIR_DOMAIN_TPM_MODEL_CRB) {
virReportError(VIR_ERR_CONFIG_UNSUPPORTED,
_("Unsupported interface %s for TPM 1.2"),
virDomainTPMModelTypeToString(tpm->model));
......@@ -7797,6 +7797,7 @@ qemuDomainDeviceDefValidateTPM(virDomainTPMDef *tpm,
case VIR_DOMAIN_TPM_MODEL_CRB:
flag = QEMU_CAPS_DEVICE_TPM_CRB;
break;
case VIR_DOMAIN_TPM_MODEL_SPAPR:
case VIR_DOMAIN_TPM_MODEL_LAST:
default:
virReportEnumRangeError(virDomainTPMModel, tpm->model);
......@@ -9036,10 +9037,16 @@ qemuDomainHostdevDefPostParse(virDomainHostdevDefPtr hostdev,
static int
qemuDomainTPMDefPostParse(virDomainTPMDefPtr tpm)
qemuDomainTPMDefPostParse(virDomainTPMDefPtr tpm,
virArch arch)
{
if (tpm->model == VIR_DOMAIN_TPM_MODEL_DEFAULT)
tpm->model = VIR_DOMAIN_TPM_MODEL_TIS;
if (tpm->model == VIR_DOMAIN_TPM_MODEL_DEFAULT) {
if (ARCH_IS_PPC64(arch))
tpm->model = VIR_DOMAIN_TPM_MODEL_SPAPR;
else
tpm->model = VIR_DOMAIN_TPM_MODEL_TIS;
}
return 0;
}
......@@ -9098,7 +9105,7 @@ qemuDomainDeviceDefPostParse(virDomainDeviceDefPtr dev,
break;
case VIR_DOMAIN_DEVICE_TPM:
ret = qemuDomainTPMDefPostParse(dev->data.tpm);
ret = qemuDomainTPMDefPostParse(dev->data.tpm, def->os.arch);
break;
case VIR_DOMAIN_DEVICE_LEASE:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册