public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: stefanha@linux.vnet.ibm.com, kvm@vger.kernel.org
Subject: [PATCH conditional] qemu-kvm: ioeventfd fixup
Date: Sun, 12 Dec 2010 13:47:06 +0200	[thread overview]
Message-ID: <20101212114706.GA14925@redhat.com> (raw)

Make ioeventfd patchset apply to qemu-kvm.

Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---

This patch will need to be applied when ioeventfd is merged in qemu.git.

 kvm-all.c  |    2 +-
 kvm.h      |    1 +
 qemu-kvm.c |    2 ++
 qemu-kvm.h |    1 +
 4 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/kvm-all.c b/kvm-all.c
index adfb892..c7bd993 100644
--- a/kvm-all.c
+++ b/kvm-all.c
@@ -455,7 +455,7 @@ int kvm_check_extension(KVMState *s, unsigned int extension)
     return ret;
 }
 
-static int kvm_check_many_ioeventfds(void)
+int kvm_check_many_ioeventfds(void)
 {
     /* Older kernels have a 6 device limit on the KVM io bus.  Find out so we
      * can avoid creating too many ioeventfds.
diff --git a/kvm.h b/kvm.h
index 45124ef..345b740 100644
--- a/kvm.h
+++ b/kvm.h
@@ -204,6 +204,7 @@ int kvm_set_irqfd(int gsi, int fd, bool assigned)
 }
 #endif
 
+int kvm_check_many_ioeventfds(void);
 int kvm_set_ioeventfd_pio_word(int fd, uint16_t adr, uint16_t val, bool assign);
 
 int kvm_has_gsi_routing(void);
diff --git a/qemu-kvm.c b/qemu-kvm.c
index 471306b..76731fe 100644
--- a/qemu-kvm.c
+++ b/qemu-kvm.c
@@ -1686,6 +1686,8 @@ static int kvm_create_context(void)
     kvm_state->xcrs = kvm_check_extension(kvm_state, KVM_CAP_XCRS);
 #endif
 
+    kvm_state->many_ioeventfds = kvm_check_many_ioeventfds();
+
     kvm_init_ap();
     if (kvm_irqchip) {
         if (!qemu_kvm_has_gsi_routing()) {
diff --git a/qemu-kvm.h b/qemu-kvm.h
index 7e6edfb..db4e340 100644
--- a/qemu-kvm.h
+++ b/qemu-kvm.h
@@ -754,6 +754,7 @@ struct KVMState {
     int irqchip_in_kernel;
     int pit_in_kernel;
     int xsave, xcrs;
+    int many_ioeventfds;
 
     struct kvm_context kvm_context;
 };
-- 
1.7.3.2.91.g446ac

                 reply	other threads:[~2010-12-12 11:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101212114706.GA14925@redhat.com \
    --to=mst@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=stefanha@linux.vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox