From 657ee18b9cca2960ea953e4eabc6898668363c34 Mon Sep 17 00:00:00 2001 From: Matt Evans Date: Tue, 6 Dec 2011 14:42:29 +1100 Subject: [PATCH] kvm tools: Fix virtio-pci endian bug when reading VIRTIO_PCI_QUEUE_NUM The field size is currently wrong, read into a 32bit word instead of 16. This casues trouble when BE. Acked-by: Asias He Signed-off-by: Matt Evans Signed-off-by: Pekka Enberg --- virtio/pci.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/virtio/pci.c b/virtio/pci.c index 3d9a7f8..d9fc3a5 100644 --- a/virtio/pci.c +++ b/virtio/pci.c @@ -115,8 +115,7 @@ static bool virtio_pci__io_in(struct ioport *ioport, struct kvm *kvm, u16 port, break; case VIRTIO_PCI_QUEUE_NUM: val = vtrans->virtio_ops->get_size_vq(kvm, vpci->dev, vpci->queue_selector); - ioport__write32(data, val); - break; + ioport__write16(data, val); break; case VIRTIO_PCI_STATUS: ioport__write8(data, vpci->status);