On 18.10.2016 14:59, zhun...@gmail.com wrote:
> Now I want to add some args about TPM  to domain's XML,so I can start a 
> domain by virt-manager or other virsh command,and then ,I would like to use 
> sVIrt security context to label vTPM and correspondingVM,But I do not know 
> how to get these XML  args in libvirt.
> the key problem is that how can i get and recognize these args!!!
> related XML content :

Usually, grepping the code for cmd name <-> XML element/attribute
translation is sufficient (esp. if you grep tests/)

> <qemu:commandline>
>     <qemu:arg value='-enable-kvm'/>

Firstly, this is obsolete in favour of "-machine accel=kvm". In any
case, <domain type='kvm'/> will do the trick (libvirt will use whatever
is supported by qemu binary in your system).

>     <qemu:arg value='-drive'/>
>     <qemu:arg 
> value='file=/root/nvram_2.0-jin.qcow2,if=none,id=nvram0-0-0,format=qcow2'/>

Okay, this is not supported by libvirt yet. We don't really have a way
how to specify NVRAM in anything other than a raw file. BTW: isn't qcow
too big gun for NVRAM? I mean, NVRAM has a fixed size of what ~190 KB?
QCOW header is about the same size.

>     <qemu:arg value='-device'/>
>     <qemu:arg value='tpm-tis,tpmdev=tpm-tpm0,id=tpm0'/>
>     <qemu:arg value='-tpmdev'/>
>     <qemu:arg value='libtpms,id=tpm-tpm0,nvram=nvram0-0-0,startup=clear'/>

I'm not sure there's a way how to put startup=clean on the cmd line. I'm
not even sure what it does.
And I have not idea what libtpms is either :-)

>     <qemu:arg value='-bios'/>
>     <qemu:arg value='/root/xenSeabios/out/bios.bin'/>
>   </qemu:commandline>


libvir-list mailing list

Reply via email to