From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M7YKV-0008EH-Ek for qemu-devel@nongnu.org; Fri, 22 May 2009 13:14:47 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M7YKQ-0008Al-SA for qemu-devel@nongnu.org; Fri, 22 May 2009 13:14:47 -0400 Received: from [199.232.76.173] (port=55268 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M7YKQ-0008AV-JM for qemu-devel@nongnu.org; Fri, 22 May 2009 13:14:42 -0400 Received: from mx2.redhat.com ([66.187.237.31]:51935) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M7YKQ-0003kn-3q for qemu-devel@nongnu.org; Fri, 22 May 2009 13:14:42 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n4MHEeQu008197 for ; Fri, 22 May 2009 13:14:40 -0400 From: Mark McLoughlin Content-Type: text/plain Date: Fri, 22 May 2009 18:14:38 +0100 Message-Id: <1243012478.29542.18.camel@blaa> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] Change virtio-console to PCI_CLASS_SERIAL_OTHER Reply-To: Mark McLoughlin List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Cc: ajax@redhat.com From: Adam Jackson We're using PCI_CLASS_DISPLAY_OTHER now, but qemu-kvm.git is using PCI_CLASS_OTHERS because: "As a PCI_CLASS_DISPLAY_OTHER, it reduces primary display somehow on Windows XP (possibly Windows disables acceleration since it fails to find a driver)." While this is valid, many versions of X will get confused by it. Class major number of 0 gets treated as a possibly prehistoric VGA device, and then the autoconfig logic gets confused trying to figure out whether the virtio console or the pv vga device are the real VGA. We should really set a proper class ID. 0x0780 (serial / other) seems most appropriate. This shouldn't require any kernel changes, the modalias for virtio looks like: alias: pci:v00001AF4d*sv*sd*bc*sc*i* so won't care what the base class or subclass are. It shows up in the guest as: 00:05.0 Communication controller: Qumranet, Inc. Virtio console Signed-off-by: Adam Jackson Signed-off-by: Mark McLoughlin --- hw/pci_ids.h | 2 ++ hw/virtio-pci.c | 2 +- 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/hw/pci_ids.h b/hw/pci_ids.h index 427fcd5..cbd9a32 100644 --- a/hw/pci_ids.h +++ b/hw/pci_ids.h @@ -35,6 +35,8 @@ #define PCI_CLASS_BRIDGE_PCI 0x0604 #define PCI_CLASS_BRIDGE_OTHER 0x0680 +#define PCI_CLASS_SERIAL_OTHER 0x0780 + #define PCI_CLASS_PROCESSOR_CO 0x0b40 #define PCI_CLASS_PROCESSOR_POWERPC 0x0b20 diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c index c072423..642e744 100644 --- a/hw/virtio-pci.c +++ b/hw/virtio-pci.c @@ -304,7 +304,7 @@ static void virtio_console_init_pci(PCIDevice *pci_dev) virtio_init_pci(proxy, vdev, PCI_VENDOR_ID_REDHAT_QUMRANET, PCI_DEVICE_ID_VIRTIO_CONSOLE, - PCI_CLASS_DISPLAY_OTHER, + PCI_CLASS_SERIAL_OTHER, 0x00); } -- 1.6.2.2