qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: device hotplug & file handles


From: Peter Krempa
Subject: Re: device hotplug & file handles
Date: Thu, 7 May 2020 18:18:57 +0200
User-agent: Mutt/1.13.4 (2020-02-15)

On Thu, May 07, 2020 at 16:49:14 +0200, Gerd Hoffmann wrote:
>   Hi,
> 
> For usb device pass-through (aka -device usb-host) it would be very
> useful to pass file handles from libvirt to qemu.  The workflow would
> change from ...
> 
>   (1) libvirt enables access to /dev/usb/$bus/$dev
>   (2) libvirt passes $bus + $dev (using hostbus + hostaddr properties)
>       to qemu.
>   (3) qemu opens /dev/usb/$bus/$dev
> 
> ... to ...
> 
>   (1) libvirt opens /dev/usb/$bus/$dev
>   (2) libvirt passes filehandle to qemu.
> 
> Question is how can we pass the file descriptor best?  My idea would be
> to simply add an fd property to usb-host:
> 
>  * Coldplug would be "-device usb-host,fd=<nr>" (cmd line).
>  * Hotplug would be "device_add usb-host,fd=<getfd-name>" (monitor).

We have prior art for both approaches so it's fine.

> 
> Will that work from libvirt point of view?

Sure! Just please make sure that the new approach is detectable somehow.
Either via device-list-properties or query-qmp-schema.

> Or does anyone have an better idea?
> 
> thanks,
>   Gerd
> 
> PS: background: https://bugzilla.redhat.com/show_bug.cgi?id=1595525
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]