qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Peter Krempa <pkrempa@redhat.com>
To: Gerd Hoffmann <kraxel@redhat.com>
Cc: libvir-list@redhat.com, qemu-devel@nongnu.org
Subject: Re: device hotplug & file handles
Date: Thu, 7 May 2020 18:18:57 +0200	[thread overview]
Message-ID: <20200507161857.GK2102825@angien.pipo.sk> (raw)
In-Reply-To: <20200507144914.4zg3753uh3kytz6g@sirius.home.kraxel.org>

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	other threads:[~2020-05-07 16:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-07 14:49 device hotplug & file handles Gerd Hoffmann
2020-05-07 16:18 ` Peter Krempa [this message]
2020-05-07 17:05 ` Eric Blake
2020-05-11 10:20 ` Michal Privoznik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200507161857.GK2102825@angien.pipo.sk \
    --to=pkrempa@redhat.com \
    --cc=kraxel@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).