From 2f4e32073042bb5835eb93e0ad49bfa7a6e63ba8 Mon Sep 17 00:00:00 2001 From: Jian Jun Chen Date: Mon, 18 Mar 2019 16:30:57 +0800 Subject: [PATCH] dm: virtio-input: adapt Windows virtio-input driver Update PCIR_SUBDEV_0 and PCIR_REVID in PCI configuration space to adapt windows virtio-input driver. Otherwise virtio-input driver on Windows will not be loaded correctly. Tracked-On: #2962 Signed-off-by: Jian Jun Chen Acked-by: Yin Fengwei --- devicemodel/hw/pci/virtio/virtio_input.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/devicemodel/hw/pci/virtio/virtio_input.c b/devicemodel/hw/pci/virtio/virtio_input.c index 9dd9deffd..a94212860 100644 --- a/devicemodel/hw/pci/virtio/virtio_input.c +++ b/devicemodel/hw/pci/virtio/virtio_input.c @@ -673,8 +673,9 @@ virtio_input_init(struct vmctx *ctx, struct pci_vdev *dev, char *opts) pci_set_cfgdata16(dev, PCIR_VENDOR, VIRTIO_VENDOR); pci_set_cfgdata8(dev, PCIR_CLASS, PCIC_INPUTDEV); pci_set_cfgdata8(dev, PCIR_SUBCLASS, PCIS_INPUTDEV_OTHER); - pci_set_cfgdata16(dev, PCIR_SUBDEV_0, 0x1040 + VIRTIO_TYPE_INPUT); + pci_set_cfgdata16(dev, PCIR_SUBDEV_0, 0x1100); pci_set_cfgdata16(dev, PCIR_SUBVEND_0, VIRTIO_VENDOR); + pci_set_cfgdata16(dev, PCIR_REVID, 1); if (virtio_interrupt_init(&vi->base, virtio_uses_msix())) { DPRINTF(("%s, interrupt_init failed!\n", __func__));