aboutsummaryrefslogtreecommitdiff
path: root/kvm-all.c
diff options
context:
space:
mode:
authorStefan Hajnoczi <stefanha@linux.vnet.ibm.com>2011-01-25 16:17:14 +0000
committerKevin Wolf <kwolf@redhat.com>2011-01-31 10:03:00 +0100
commitd0dcac833a767dade968a07aba4d116f162ebc72 (patch)
tree44424b95b63e18b1dc4bca9c40739664d959aa86 /kvm-all.c
parente5051fc70807750f7a4798d2d83e159793c466d3 (diff)
downloadqemu-d0dcac833a767dade968a07aba4d116f162ebc72.zip
qemu-d0dcac833a767dade968a07aba4d116f162ebc72.tar.gz
qemu-d0dcac833a767dade968a07aba4d116f162ebc72.tar.bz2
virtio-pci: Disable virtio-ioeventfd when !CONFIG_IOTHREAD
It is not possible to use virtio-ioeventfd when building without an I/O thread. We rely on a signal to kick us out of vcpu execution. Timers and AIO use SIGALRM and SIGUSR2 respectively. Unfortunately eventfd does not support O_ASYNC (SIGIO) so eventfd cannot be used in a signal driven manner. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'kvm-all.c')
-rw-r--r--kvm-all.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/kvm-all.c b/kvm-all.c
index 255b6fa..8f0e17c 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -449,10 +449,14 @@ int kvm_check_extension(KVMState *s, unsigned int extension)
static int kvm_check_many_ioeventfds(void)
{
- /* Older kernels have a 6 device limit on the KVM io bus. Find out so we
+ /* Userspace can use ioeventfd for io notification. This requires a host
+ * that supports eventfd(2) and an I/O thread; since eventfd does not
+ * support SIGIO it cannot interrupt the vcpu.
+ *
+ * Older kernels have a 6 device limit on the KVM io bus. Find out so we
* can avoid creating too many ioeventfds.
*/
-#ifdef CONFIG_EVENTFD
+#if defined(CONFIG_EVENTFD) && defined(CONFIG_IOTHREAD)
int ioeventfds[7];
int i, ret = 0;
for (i = 0; i < ARRAY_SIZE(ioeventfds); i++) {