qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PATCH 2/2] virtio-pci: fallback to userspace when there is


From: Amos Kong
Subject: [Qemu-devel] [PATCH 2/2] virtio-pci: fallback to userspace when there is no enough available ioeventfd
Date: Tue, 13 Mar 2012 18:42:40 +0800
User-agent: StGit/0.15

Qemu already supported multiple function devices, pci-bridge
would support more pci devices. But iobus dev in kernel are
limited. If there is no enough available ioeventfd, then
clean VIRTIO_PCI_FLAG_USE_IOEVENTFD bit, virtio-pci would
fallback to userspace.

Signed-off-by: Amos Kong <address@hidden>
---
 hw/virtio-pci.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/hw/virtio-pci.c b/hw/virtio-pci.c
index d63f303..d15b11b 100644
--- a/hw/virtio-pci.c
+++ b/hw/virtio-pci.c
@@ -322,6 +322,9 @@ static void virtio_ioport_write(void *opaque, uint32_t 
addr, uint32_t val)
         virtio_set_status(vdev, val & 0xFF);
 
         if (val & VIRTIO_CONFIG_S_DRIVER_OK) {
+            if (kvm_has_many_ioeventfds() == 0) {
+                proxy->flags &= ~VIRTIO_PCI_FLAG_USE_IOEVENTFD;
+            }
             virtio_pci_start_ioeventfd(proxy);
         }
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]