提交 c772feb0 编写于 作者: S Stefan Berger 提交者: Stefan Berger

Add test case for TPM passthrough

Signed-off-by: NStefan Berger <stefanb@linux.vnet.ibm.com>
Reviewed-by: NCorey Bryant <coreyb@linux.vnet.ibm.com>
Tested-by: NCorey Bryant <coreyb@linux.vnet.ibm.com>
上级 291cfb83
LC_ALL=C PATH=/bin HOME=/home/test USER=test LOGNAME=test \
/usr/bin/qemu -S -M pc-0.12 -m 2048 -smp 1 -nographic -nodefaults \
-monitor unix:/tmp/test-monitor,server,nowait -boot c -usb \
-tpmdev passthrough,id=tpm-tpm0,path=/dev/tpm0,cancel-path=/sys/class/misc/tpm0/device/cancel \
-device tpm-tis,tpmdev=tpm-tpm0,id=tpm0 \
-device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x3
<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-0.12'>hvm</type>
<boot dev='hd'/>
<bootmenu enable='yes'/>
</os>
<features>
<acpi/>
</features>
<clock offset='utc'/>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>destroy</on_crash>
<devices>
<emulator>/usr/bin/qemu</emulator>
<controller type='usb' index='0'/>
<tpm model='tpm-tis'>
<backend type='passthrough'>
<device path='/dev/tpm0'/>
</backend>
</tpm>
<memballoon model='virtio'/>
</devices>
</domain>
...@@ -937,6 +937,9 @@ mymain(void) ...@@ -937,6 +937,9 @@ mymain(void)
DO_TEST("ppc-dtb", QEMU_CAPS_KVM, QEMU_CAPS_DTB); DO_TEST("ppc-dtb", QEMU_CAPS_KVM, QEMU_CAPS_DTB);
DO_TEST("tpm-passthrough", QEMU_CAPS_DEVICE,
QEMU_CAPS_DEVICE_TPM_PASSTHROUGH, QEMU_CAPS_DEVICE_TPM_TIS);
virObjectUnref(driver.config); virObjectUnref(driver.config);
virObjectUnref(driver.caps); virObjectUnref(driver.caps);
virObjectUnref(driver.xmlopt); virObjectUnref(driver.xmlopt);
......
...@@ -274,6 +274,8 @@ mymain(void) ...@@ -274,6 +274,8 @@ mymain(void)
DO_TEST_DIFFERENT("metadata"); DO_TEST_DIFFERENT("metadata");
DO_TEST("tpm-passthrough");
virObjectUnref(driver.caps); virObjectUnref(driver.caps);
virObjectUnref(driver.xmlopt); virObjectUnref(driver.xmlopt);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册