mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 13:45:38 +00:00
d79542eec6
Get the JSON profile that the swtpm instance was created with from the output of 'swtpm socket --tpm2 --print-info 0x20 --tpmstate ...'. Get the name of the profile from the JSON and set it in the current and persistent emulator descriptions as 'name' attribute and have the persistent description stored with this update. The user should avoid setting this 'name' attribute since it is meant to be read-only. The following is an example of how the XML could look like: <profile source='local:restricted' name='custom:restricted'/> If the user provided no profile node, and therefore swtpm_setup picked its default profile, the XML may now shows the 'name' attribute with the name of the profile. This makes the 'source' attribute now optional. <profile name='default-v1'/> Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
41 lines
1.3 KiB
XML
41 lines
1.3 KiB
XML
<domain type='qemu'>
|
|
<name>TPM-VM</name>
|
|
<uuid>11d7cd22-da89-3094-6212-079a48a309a1</uuid>
|
|
<memory unit='KiB'>2097152</memory>
|
|
<currentMemory unit='KiB'>512288</currentMemory>
|
|
<vcpu placement='static'>1</vcpu>
|
|
<os>
|
|
<type arch='x86_64' machine='pc-i440fx-2.12'>hvm</type>
|
|
<boot dev='hd'/>
|
|
<bootmenu enable='yes'/>
|
|
</os>
|
|
<features>
|
|
<acpi/>
|
|
</features>
|
|
<cpu mode='custom' match='exact' check='none'>
|
|
<model fallback='forbid'>qemu64</model>
|
|
</cpu>
|
|
<clock offset='utc'/>
|
|
<on_poweroff>destroy</on_poweroff>
|
|
<on_reboot>restart</on_reboot>
|
|
<on_crash>destroy</on_crash>
|
|
<devices>
|
|
<emulator>/usr/bin/qemu-system-x86_64</emulator>
|
|
<controller type='usb' index='0' model='piix3-uhci'>
|
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x01' function='0x2'/>
|
|
</controller>
|
|
<controller type='pci' index='0' model='pci-root'/>
|
|
<input type='mouse' bus='ps2'/>
|
|
<input type='keyboard' bus='ps2'/>
|
|
<tpm model='tpm-crb'>
|
|
<backend type='emulator' version='2.0'>
|
|
<profile source='local:restricted' removeDisabled='check' name='custom:restricted'/>
|
|
</backend>
|
|
</tpm>
|
|
<audio id='1' type='none'/>
|
|
<memballoon model='virtio'>
|
|
<address type='pci' domain='0x0000' bus='0x00' slot='0x02' function='0x0'/>
|
|
</memballoon>
|
|
</devices>
|
|
</domain>
|