Suggest to say
usb: Add QOM property "attached"
The quotes make more obvious that "attached" is a property name, not an
adjective tacked to property.
Gerd Hoffmann <[email protected]> writes:
> USB devices in attached state are visible to the guest.
If I read the code correctly:
* ->attached is true between usb_device_attach() and usb_device_detach()
* Attach and detach is automatic on realize and unrealize, but a device
can choose to suppress attach on realize, by unsetting ->auto_attach,
and manage attach/detach itself.
* A detached device is wired up normally in QOM, but the USB core treats
it as not plugged into its USB port.
Correct?
> This patch adds
> a QOM property for this. Write access is opt-in per device. Some
> devices manage attached state automatically (usb-host, usb-serial), so
Full list of devices unsetting ->auto_attach: dev-serial.c dev-storage.c
host-libusb.c redirect.c.
dev-storage.c does it only for encrypted media without a key, but that
should go away with Dan's "Support LUKS encryption in block devices", so
I guess neglecting to mention it here is okay.
Suggest to add usb-redir to your list.
> we can't enable write access universally but have to do it on a case by
> case base.
Suggest to add: So far, no device opts in.
>
> Signed-off-by: Gerd Hoffmann <[email protected]>
Patch looks good.