Hi, Gerd > From: Gerd Hoffmann [mailto:kra...@redhat.com] > Sent: Thursday, August 28, 2014 4:36 PM > Subject: Re: [Qemu-devel] USB PCI host bus adapter hot plug > > Hi, > > > > The last missing bit (beside the make check failures) needed to finally > > > merge this is turning off hotplug in case we have a companion setup. > > > > > Have a patch work for this yet? Thanks. > > Havn't found time to do it yet. Patches are welcome. >
Signed-off-by: Gonglei <arei.gong...@huawei.com> ---- diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index 6248c19..627d2fd 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c @@ -1302,6 +1302,7 @@ static void uhci_class_init(ObjectClass *klass, void *data) k->class_id = PCI_CLASS_SERIAL_USB; dc->vmsd = &vmstate_uhci; dc->props = uhci_properties; + dc->hotpluggable = info->unplug ? true : false; set_bit(DEVICE_CATEGORY_USB, dc->categories); u->info = *info; } Using above patch, the hotplugging for companion controller will be forbidden. My testcase: # ./qemu-system-x86_64 -enable-kvm -m 4096 -smp 4 -name sles-ethernet -boot c -drive \ file=/mnt/sdb/gonglei/image/win7_32_2U -vnc 0.0.0.0:10 -monitor stdio -readconfig ../docs/ich9-ehci-uhci.cfg QEMU 2.1.50 monitor - type 'help' for more information (qemu) info pci Bus 0, device 0, function 0: Host bridge: PCI device 8086:1237 id "" Bus 0, device 1, function 0: ISA bridge: PCI device 8086:7000 id "" Bus 0, device 1, function 1: IDE controller: PCI device 8086:7010 BAR4: I/O at 0xc0a0 [0xc0af]. id "" Bus 0, device 1, function 3: Bridge: PCI device 8086:7113 IRQ 9. id "" Bus 0, device 2, function 0: VGA controller: PCI device 1013:00b8 BAR0: 32 bit prefetchable memory at 0xfc000000 [0xfdffffff]. BAR1: 32 bit memory at 0xfebf0000 [0xfebf0fff]. BAR6: 32 bit memory at 0xffffffffffffffff [0x0000fffe]. id "" Bus 0, device 3, function 0: Ethernet controller: PCI device 8086:100e IRQ 11. BAR0: 32 bit memory at 0xfebc0000 [0xfebdffff]. BAR1: I/O at 0xc000 [0xc03f]. BAR6: 32 bit memory at 0xffffffffffffffff [0x0003fffe]. id "" Bus 0, device 29, function 0: USB controller: PCI device 8086:2934 IRQ 10. BAR4: I/O at 0xc040 [0xc05f]. id "uhci-1" Bus 0, device 29, function 1: USB controller: PCI device 8086:2935 IRQ 10. BAR4: I/O at 0xc060 [0xc07f]. id "uhci-2" Bus 0, device 29, function 2: USB controller: PCI device 8086:2936 IRQ 11. BAR4: I/O at 0xc080 [0xc09f]. id "uhci-3" Bus 0, device 29, function 7: USB controller: PCI device 8086:293a IRQ 11. BAR0: 32 bit memory at 0xfebf1000 [0xfebf1fff]. id "ehci" (qemu) device_del uhci-1 Device 'ich9-usb-uhci1' does not support hotplugging (qemu) device_del uhci-2 Device 'ich9-usb-uhci2' does not support hotplugging (qemu) device_del uhci-3 Device 'ich9-usb-uhci3' does not support hotplugging (qemu) device_del ehci ----------------------->this process will not take effect...see below 'info pci' pls. (qemu) info pci Bus 0, device 0, function 0: Host bridge: PCI device 8086:1237 id "" Bus 0, device 1, function 0: ISA bridge: PCI device 8086:7000 id "" Bus 0, device 1, function 1: IDE controller: PCI device 8086:7010 BAR4: I/O at 0xc0a0 [0xc0af]. id "" Bus 0, device 1, function 3: Bridge: PCI device 8086:7113 IRQ 9. id "" Bus 0, device 2, function 0: VGA controller: PCI device 1013:00b8 BAR0: 32 bit prefetchable memory at 0xfc000000 [0xfdffffff]. BAR1: 32 bit memory at 0xfebf0000 [0xfebf0fff]. BAR6: 32 bit memory at 0xffffffffffffffff [0x0000fffe]. id "" Bus 0, device 3, function 0: Ethernet controller: PCI device 8086:100e IRQ 11. BAR0: 32 bit memory at 0xfebc0000 [0xfebdffff]. BAR1: I/O at 0xc000 [0xc03f]. BAR6: 32 bit memory at 0xffffffffffffffff [0x0003fffe]. id "" Bus 0, device 29, function 0: USB controller: PCI device 8086:2934 IRQ 10. BAR4: I/O at 0xc040 [0xc05f]. id "uhci-1" Bus 0, device 29, function 1: USB controller: PCI device 8086:2935 IRQ 5. BAR4: I/O at 0xc060 [0xc07f]. id "uhci-2" Bus 0, device 29, function 2: USB controller: PCI device 8086:2936 IRQ 11. BAR4: I/O at 0xc080 [0xc09f]. id "uhci-3" Bus 0, device 29, function 7: USB controller: PCI device 8086:293a IRQ 10. BAR0: 32 bit memory at 0xfebf1000 [0xfebf1fff]. id "ehci" (qemu) Best regards, -Gonglei