Patchwork [for-1.3] usb: tag usb host adapters as not hotpluggable.

login
register
mail settings
Submitter Gerd Hoffmann
Date Nov. 22, 2012, 1:50 p.m.
Message ID <1353592220-385-1-git-send-email-kraxel@redhat.com>
Download mbox | patch
Permalink /patch/201046/
State New
Headers show

Comments

Gerd Hoffmann - Nov. 22, 2012, 1:50 p.m.
Hotplugging them simply doesn't work, so tag them accordingly to
avoid users trying and then crashing qemu.

For xhci there is nothing fundamental which prevents hotplug from
working, we'll "only" need a exit() function which cleans up
everything properly.  That isn't for 1.3 though.

For ehci+uhci+ohci hotplug can't be supported until qemu gains the
capability to hotplug multifunction pci devices.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/usb/hcd-ehci-pci.c |    1 +
 hw/usb/hcd-ohci.c     |    1 +
 hw/usb/hcd-uhci.c     |    1 +
 hw/usb/hcd-xhci.c     |    1 +
 4 files changed, 4 insertions(+), 0 deletions(-)
Paolo Bonzini - Nov. 22, 2012, 5:23 p.m.
Il 22/11/2012 14:50, Gerd Hoffmann ha scritto:
> Hotplugging them simply doesn't work, so tag them accordingly to
> avoid users trying and then crashing qemu.
> 
> For xhci there is nothing fundamental which prevents hotplug from
> working, we'll "only" need a exit() function which cleans up
> everything properly.  That isn't for 1.3 though.
> 
> For ehci+uhci+ohci hotplug can't be supported until qemu gains the
> capability to hotplug multifunction pci devices.

I think it works but you have to hot-plug function 0 last.

Can you add a pointer to a launchpad bug or (if there was one) a ML
message reporting the failure?

Paolo
Gerd Hoffmann - Nov. 23, 2012, 6:40 a.m.
On 11/22/12 18:23, Paolo Bonzini wrote:
> Il 22/11/2012 14:50, Gerd Hoffmann ha scritto:
>> Hotplugging them simply doesn't work, so tag them accordingly to
>> avoid users trying and then crashing qemu.
>>
>> For xhci there is nothing fundamental which prevents hotplug from
>> working, we'll "only" need a exit() function which cleans up
>> everything properly.  That isn't for 1.3 though.
>>
>> For ehci+uhci+ohci hotplug can't be supported until qemu gains the
>> capability to hotplug multifunction pci devices.
> 
> I think it works but you have to hot-plug function 0 last.
> 
> Can you add a pointer to a launchpad bug or (if there was one) a ML
> message reporting the failure?

https://bugzilla.redhat.com/show_bug.cgi?id=879096

cheers,
  Gerd

Patch

diff --git a/hw/usb/hcd-ehci-pci.c b/hw/usb/hcd-ehci-pci.c
index 5887eab..41dbb53 100644
--- a/hw/usb/hcd-ehci-pci.c
+++ b/hw/usb/hcd-ehci-pci.c
@@ -123,6 +123,7 @@  static void ehci_class_init(ObjectClass *klass, void *data)
     k->revision = i->revision;
     k->class_id = PCI_CLASS_SERIAL_USB;
     k->config_write = usb_ehci_pci_write_config;
+    k->no_hotplug = 1;
     dc->vmsd = &vmstate_ehci_pci;
     dc->props = ehci_pci_properties;
 }
diff --git a/hw/usb/hcd-ohci.c b/hw/usb/hcd-ohci.c
index 64de906..e16a2ec 100644
--- a/hw/usb/hcd-ohci.c
+++ b/hw/usb/hcd-ohci.c
@@ -1882,6 +1882,7 @@  static void ohci_pci_class_init(ObjectClass *klass, void *data)
     k->vendor_id = PCI_VENDOR_ID_APPLE;
     k->device_id = PCI_DEVICE_ID_APPLE_IPID_USB;
     k->class_id = PCI_CLASS_SERIAL_USB;
+    k->no_hotplug = 1;
     dc->desc = "Apple USB Controller";
     dc->props = ohci_pci_properties;
 }
diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c
index 8e47803..d053791 100644
--- a/hw/usb/hcd-uhci.c
+++ b/hw/usb/hcd-uhci.c
@@ -1327,6 +1327,7 @@  static void uhci_class_init(ObjectClass *klass, void *data)
     k->device_id = info->device_id;
     k->revision  = info->revision;
     k->class_id  = PCI_CLASS_SERIAL_USB;
+    k->no_hotplug = 1;
     dc->vmsd = &vmstate_uhci;
     dc->props = uhci_properties;
     u->info = *info;
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index 8ef4b07..efb509e 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -3167,6 +3167,7 @@  static void xhci_class_init(ObjectClass *klass, void *data)
     k->class_id     = PCI_CLASS_SERIAL_USB;
     k->revision     = 0x03;
     k->is_express   = 1;
+    k->no_hotplug   = 1;
 }
 
 static TypeInfo xhci_info = {