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 <asias.hejun@gmail.com>
Signed-off-by: Matt Evans <matt@ozlabs.org>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
This commit is contained in:
Matt Evans
2015-06-01 16:39:49 +01:00
committed by Will Deacon
parent af7b086859
commit 657ee18b9c
+1 -2
View File
@@ -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);