From patchwork Thu Nov 29 13:13:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 202745 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 650432C0095 for ; Fri, 30 Nov 2012 00:39:27 +1100 (EST) Received: from localhost ([::1]:46902 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Te3wk-0003bc-R3 for incoming@patchwork.ozlabs.org; Thu, 29 Nov 2012 08:14:30 -0500 Received: from eggs.gnu.org ([208.118.235.92]:34546) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Te3w9-0001zS-Ef for qemu-devel@nongnu.org; Thu, 29 Nov 2012 08:13:54 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Te3vz-0003os-7g for qemu-devel@nongnu.org; Thu, 29 Nov 2012 08:13:53 -0500 Received: from mx1.redhat.com ([209.132.183.28]:46013) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Te3vy-0003oa-VH for qemu-devel@nongnu.org; Thu, 29 Nov 2012 08:13:43 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qATDDgtf014403 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 29 Nov 2012 08:13:42 -0500 Received: from rincewind.home.kraxel.org (ovpn-116-17.ams2.redhat.com [10.36.116.17]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qATDDfWi001384; Thu, 29 Nov 2012 08:13:41 -0500 Received: by rincewind.home.kraxel.org (Postfix, from userid 500) id EB799403DA; Thu, 29 Nov 2012 14:13:40 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Thu, 29 Nov 2012 14:13:38 +0100 Message-Id: <1354194820-7767-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1354194820-7767-1-git-send-email-kraxel@redhat.com> References: <1354194820-7767-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Gerd Hoffmann Subject: [Qemu-devel] [PATCH 1/3] usb: tag usb host adapters as not hotpluggable. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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. https://bugzilla.redhat.com/show_bug.cgi?id=879096 Signed-off-by: Gerd Hoffmann --- 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(-) 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 = {