libvirt/tests/qemuxml2argvdata/aarch64-tpm.aarch64-latest.args
Jim Fehlig 7cf60006ce qemu: Fix swtpm device with aarch64
Starting a VM with swtpm device fails with qemu-system-aarch64.
E.g. with TPM device config

     <tpm model='tpm-tis'>
       <backend type='emulator' version='2.0'/>
      </tpm>

QEMU reports the following error

error: internal error: process exited while connecting to monitor:
2021-02-07T05:15:35.378927Z qemu-system-aarch64: -device
tpm-tis,tpmdev=tpm-tpm0,id=tpm0: 'tpm-tis' is not a valid device model name

Indeed the TPM device name is 'tpm-tis-device' [1][2] for aarch64,
versus the shorter 'tpm-tis' for x86. The devices are the same from
a functional POV, i.e. they both emulate a TPM device conforming to
the TIS specification. Account for the unfortunate name difference
when building the TPM device option in qemuBuildTPMDevStr(). Also
include a test case for 'tpm-tis-device'.

[1] https://qemu.readthedocs.io/en/latest/specs/tpm.html
[2] c294ac327c

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
2021-02-11 10:08:52 -07:00

38 lines
1.2 KiB
Plaintext

LC_ALL=C \
PATH=/bin \
HOME=/tmp/lib/domain--1-aarch64test \
USER=test \
LOGNAME=test \
XDG_DATA_HOME=/tmp/lib/domain--1-aarch64test/.local/share \
XDG_CACHE_HOME=/tmp/lib/domain--1-aarch64test/.cache \
XDG_CONFIG_HOME=/tmp/lib/domain--1-aarch64test/.config \
QEMU_AUDIO_DRV=none \
/usr/bin/qemu-system-aarch64 \
-name guest=aarch64test,debug-threads=on \
-S \
-object secret,id=masterKey0,format=raw,\
file=/tmp/lib/domain--1-aarch64test/master-key.aes \
-machine virt,accel=tcg,usb=off,dump-guest-core=off,gic-version=2,\
memory-backend=mach-virt.ram \
-cpu cortex-a15 \
-m 1024 \
-object memory-backend-ram,id=mach-virt.ram,size=1073741824 \
-overcommit mem-lock=off \
-smp 1,sockets=1,cores=1,threads=1 \
-uuid 496d7ea8-9739-544b-4ebd-ef08be936e8b \
-display none \
-no-user-config \
-nodefaults \
-chardev socket,id=charmonitor,fd=1729,server,nowait \
-mon chardev=charmonitor,id=monitor,mode=control \
-rtc base=utc \
-no-shutdown \
-no-acpi \
-boot strict=on \
-tpmdev emulator,id=tpm-tpm0,chardev=chrtpm \
-chardev socket,id=chrtpm,path=/dev/test \
-device tpm-tis-device,tpmdev=tpm-tpm0,id=tpm0 \
-sandbox on,obsolete=deny,elevateprivileges=deny,spawn=deny,\
resourcecontrol=deny \
-msg timestamp=on