All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: "Andreas Färber" <afaerber@suse.de>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Markus Armbruster <armbru@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 3/4] usb-bot: hotplug support
Date: Wed, 03 Feb 2016 08:58:46 +0100	[thread overview]
Message-ID: <1454486326.4967.22.camel@redhat.com> (raw)
In-Reply-To: <56B0F286.9090206@suse.de>

On Di, 2016-02-02 at 19:16 +0100, Andreas Färber wrote:
> Am 02.02.2016 um 14:36 schrieb Markus Armbruster:
> > Gerd Hoffmann <kraxel@redhat.com> writes:
> > 
> >> This patch marks usb-bot as hot-pluggable device, makes attached
> >> property settable and turns off auto-attach in case the device
> >> was hotplugged.
> >>
> >> Hot-plugging a usb-bot device with one or more scsi devices can be
> >> done this way now:
> >>
> >>   (1) device-add usb-bot,id=foo
> >>   (2) device-add scsi-{hd,cd},bus=foo.0,lun=0
> >>   (2b) optionally add more devices (luns 0 ... 15).
> >>   (3) qom-set foo.attached = true
> > 
> > This isn't exactly pretty, but it beats no hot plug.
> > 
> > A general solution for hot plugging composite devices could perhaps be
> > prettier, but I'm not aware of any recent work in the area.  Andreas,
> > Paolo?
> 
> Not aware, no. Essentially we'd need a DeviceClass::dont_realize flag,
> right?

Naa, not that simple I think.  We would need some way to create a group
of devices, then plug them all at once.

Case one is multi-function pci.

Case two are usb storage devices (bot + uas aka bulk-only-transport and
usb-attached-scsi).

I'm not aware of other cases.

Multifunction pci has been handled recently with a pci-specific hack:
pci functions are not visible to the guest until function 0 is plugged.
So you just have to plug them in the correct order (function 0 last) to
get things going.  Works because the common pci slot implicitly groups
devices.

So this is handles the usb storage devices with a usb specific hack:
usb devices can exist without being visible to the guest
(attached=false).  We can use that to create the device group (usb
storage adapter and the scsi device(s) connected to it) without the
guest seeing a half-composed device, when done we go flip the
visibility.

cheers,
  Gerd

  reply	other threads:[~2016-02-03  7:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-26 10:41 [Qemu-devel] [PATCH 0/4] usb: hotplug support for usb-bot and usb-uas Gerd Hoffmann
2016-01-26 10:41 ` [Qemu-devel] [PATCH 1/4] usb: make USBDevice->attached bool Gerd Hoffmann
2016-02-02 13:06   ` Markus Armbruster
2016-01-26 10:41 ` [Qemu-devel] [PATCH 2/4] usb: add attached property Gerd Hoffmann
2016-02-02 13:33   ` Markus Armbruster
2016-02-02 14:25     ` Gerd Hoffmann
2016-02-02 15:37       ` Markus Armbruster
2016-01-26 10:41 ` [Qemu-devel] [PATCH 3/4] usb-bot: hotplug support Gerd Hoffmann
2016-02-02 13:36   ` Markus Armbruster
2016-02-02 18:16     ` Andreas Färber
2016-02-03  7:58       ` Gerd Hoffmann [this message]
2016-01-26 10:41 ` [Qemu-devel] [PATCH 4/4] usb-uas: " Gerd Hoffmann
2016-02-02 13:36   ` Markus Armbruster

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=1454486326.4967.22.camel@redhat.com \
    --to=kraxel@redhat.com \
    --cc=afaerber@suse.de \
    --cc=armbru@redhat.com \
    --cc=pbonzini@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.