qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Change virtio-console to PCI_CLASS_SERIAL_OTHER
@ 2009-05-22 17:14 Mark McLoughlin
  2009-05-24  9:11 ` Avi Kivity
  2009-05-27 14:21 ` Anthony Liguori
  0 siblings, 2 replies; 27+ messages in thread
From: Mark McLoughlin @ 2009-05-22 17:14 UTC (permalink / raw)
  To: qemu-devel; +Cc: ajax

From: Adam Jackson <ajax@redhat.com>

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 <ajax@redhat.com>
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
---
 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

^ permalink raw reply related	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2009-06-02 13:41 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-22 17:14 [Qemu-devel] [PATCH] Change virtio-console to PCI_CLASS_SERIAL_OTHER Mark McLoughlin
2009-05-24  9:11 ` Avi Kivity
2009-05-27 14:21 ` Anthony Liguori
2009-05-27 17:42   ` Mark McLoughlin
2009-05-27 22:37     ` Anthony Liguori
2009-05-28  9:33       ` Mark McLoughlin
2009-05-28  9:44         ` Anthony Liguori
2009-05-28 12:53     ` Paul Brook
2009-05-28 12:56       ` Anthony Liguori
2009-05-28 13:22         ` Paul Brook
2009-05-28 13:29           ` Anthony Liguori
2009-05-28 21:45             ` Dor Laor
2009-05-29  9:43               ` Mark McLoughlin
2009-05-29  9:50                 ` Anthony Liguori
2009-05-31 14:32                   ` Avi Kivity
2009-05-29  9:55                 ` Anthony Liguori
2009-05-29 10:09                 ` Mark McLoughlin
2009-05-31 14:47                   ` Dor Laor
2009-06-02  8:49                     ` Mark McLoughlin
2009-06-02 13:08                       ` Dor Laor
2009-06-02 13:39                         ` Mark McLoughlin
2009-05-31 14:35                 ` Dor Laor
2009-06-02  8:49                   ` Mark McLoughlin
2009-05-28 13:04       ` Daniel P. Berrange
2009-05-28 13:19         ` Anthony Liguori
2009-05-31 18:48           ` Jamie Lokier
2009-05-28 13:20         ` Paul Brook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).