From: Stefan Weil <weil@mail.berlios.de>
To: QEMU Developers <qemu-devel@nongnu.org>
Cc: Anthony Liguori <aliguori@us.ibm.com>,
Cam Macdonell <cam@cs.ualberta.ca>
Subject: [Qemu-devel] [PATCH 2/2] ivshmem: Fix compilation without kvm
Date: Wed, 11 Aug 2010 09:38:54 +0200 [thread overview]
Message-ID: <1281512334-4268-2-git-send-email-weil@mail.berlios.de> (raw)
In-Reply-To: <1281512334-4268-1-git-send-email-weil@mail.berlios.de>
kvm_set_ioeventfd_mmio_long is only available with CONFIG_KVM.
Cc: Anthony Liguori <aliguori@us.ibm.com>
Cc: Cam Macdonell <cam@cs.ualberta.ca>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
hw/ivshmem.c | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/hw/ivshmem.c b/hw/ivshmem.c
index ec894e9..63562e1 100644
--- a/hw/ivshmem.c
+++ b/hw/ivshmem.c
@@ -385,8 +385,10 @@ static void close_guest_eventfds(IVShmemState *s, int posn)
guest_curr_max = s->peers[posn].nb_eventfds;
for (i = 0; i < guest_curr_max; i++) {
+#if defined(CONFIG_KVM)
kvm_set_ioeventfd_mmio_long(s->peers[posn].eventfds[i],
s->mmio_addr + DOORBELL, (posn << 16) | i, 0);
+#endif
close(s->peers[posn].eventfds[i]);
}
@@ -395,7 +397,7 @@ static void close_guest_eventfds(IVShmemState *s, int posn)
}
static void setup_ioeventfds(IVShmemState *s) {
-
+#if defined(CONFIG_KVM)
int i, j;
for (i = 0; i <= s->max_peer; i++) {
@@ -404,6 +406,7 @@ static void setup_ioeventfds(IVShmemState *s) {
s->mmio_addr + DOORBELL, (i << 16) | j, 1);
}
}
+#endif
}
/* this function increase the dynamic storage need to store data about other
@@ -530,12 +533,14 @@ static void ivshmem_read(void *opaque, const uint8_t * buf, int flags)
guest_max_eventfd);
}
+#if defined(CONFIG_KVM)
if (ivshmem_has_feature(s, IVSHMEM_IOEVENTFD)) {
if (kvm_set_ioeventfd_mmio_long(incoming_fd, s->mmio_addr + DOORBELL,
(incoming_posn << 16) | guest_max_eventfd, 1) < 0) {
fprintf(stderr, "ivshmem: ioeventfd not available\n");
}
}
+#endif
return;
}
--
1.7.1
next prev parent reply other threads:[~2010-08-11 7:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-11 7:38 [Qemu-devel] [PATCH 1/2] ivshmem: Fix compilation (wrong format specifier) Stefan Weil
2010-08-11 7:38 ` Stefan Weil [this message]
2010-08-11 17:05 ` [Qemu-devel] Re: [PATCH 2/2] ivshmem: Fix compilation without kvm Paolo Bonzini
2010-08-11 17:18 ` Blue Swirl
2010-08-11 18:11 ` Paolo Bonzini
2010-08-11 17:58 ` Cam Macdonell
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=1281512334-4268-2-git-send-email-weil@mail.berlios.de \
--to=weil@mail.berlios.de \
--cc=aliguori@us.ibm.com \
--cc=cam@cs.ualberta.ca \
--cc=qemu-devel@nongnu.org \
/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;
as well as URLs for NNTP newsgroup(s).