usb-host resets the host device (libusb_reset_device) whenever it lets go
of it: when the device is removed or its host device closed, when QEMU
exits, and when an open fails. An iPhone given to a macOS guest is left in
a state from which the next guest loses it. macOS asks a new iPhone to
switch its USB mode (vendor request 0xc052), after which it re-enumerates
once; after the reset QEMU made as a VM stopped, the next VM's guest asked
the switch again, and the iPhone left the bus 1 s later and did not come
back until it was plugged in again.
usb-host gains reset-on-close, on by default. Off, QEMU releases the
device's interfaces and gives them back to the host's drivers without
resetting it, so it stays in the configuration and mode the guest left.
Across a guest reboot, where QEMU let go of nothing, a macOS 27.2.1 guest
under KVM found the iPhone in its switched mode, asked no switch, set its
configuration and drove it: usbmuxd took its multiplexor interface and
AppleUSBNCM11 its two network interfaces.
Not for upstream: written with an AI assistant, which QEMU's policy on
AI-generated content (docs/devel/code-provenance.rst) declines.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>