[libvirt] [PATCH] qemu: Pass file descriptor when using TPM passthrough

Stefan Berger stefanb at linux.vnet.ibm.com
Mon Sep 22 13:51:11 UTC 2014


On 09/08/2014 09:05 PM, Stefan Berger wrote:
> From: Stefan Berger <stefanb at linux.vnet.ibm.com>
>
> Pass the TPM file descriptor to QEMU via command line.
> Instead of passing /dev/tpm0 we now pass /dev/fdset/10 and the additional
> parameters -add-fd set=10,fd=20.
>
> This addresses the use case when QEMU is started with non-root privileges
> and QEMU cannot open /dev/tpm0 for example.
>
> One problem is that for the passing of the file descriptor set to work,
> virCommandReorderFDs must not be called on the virCommand. This is prevented
> by setting a flag in the virCommandPassFDGetFDIndex that is checked to be
> clear when virCommandReorderFDs is run.
>
> Signed-off-by: Stefan Berger <stefanb at linux.vnet.ibm.com>
> ---
>   src/libvirt_private.syms |   1 +
>   src/qemu/qemu_command.c  | 132 ++++++++++++++++++++++++++++++++++++++++++++---
>   src/util/vircommand.c    |  33 ++++++++++++
>   src/util/vircommand.h    |   3 ++
>   4 files changed, 162 insertions(+), 7 deletions(-)

Does anyone have comments?

     Stefan




More information about the libvir-list mailing list