[PATCH] kvmtool: fix wrong bus type and width in KVM_IOEVENTFD ioctl() call on MMIO bus

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch is to fix wrong parameters of ioctl(KVM_IOEVENTFD) calls, otherwise
macvtap + vhost-net is broken, that is:

1. we should register these address range on MMIO bus instead of PIO bus.
2. the register VIRTIO_PCI_QUEUE_NOTIFY should be 16-bits width.

Signed-off-by: Yu Li <raise.sail@xxxxxxxxx>

diff --git a/tools/kvm/virtio/pci.c b/tools/kvm/virtio/pci.c
index 7556239..fcf8e93 100644
--- a/tools/kvm/virtio/pci.c
+++ b/tools/kvm/virtio/pci.c
@@ -57,8 +57,9 @@ static int virtio_pci__init_ioeventfd(struct kvm *kvm, struct virtio_device *vde

 	/* mmio */
 	ioevent.io_addr	= vpci->mmio_addr + VIRTIO_PCI_QUEUE_NOTIFY;
-	ioevent.io_len	= sizeof(u32);
+	ioevent.io_len	= sizeof(u16);
 	ioevent.fd	= fds[1] = eventfd(0, 0);
+	flags &= ~IOEVENTFD_FLAG_PIO;
 	r = ioeventfd__add_event(&ioevent, flags);
 	if (r)
 		goto free_ioport_evt;
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux