From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=35909 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oj5uS-0001Rl-FI for qemu-devel@nongnu.org; Wed, 11 Aug 2010 03:39:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oj5uQ-0006Ph-0f for qemu-devel@nongnu.org; Wed, 11 Aug 2010 03:39:35 -0400 Received: from moutng.kundenserver.de ([212.227.126.186]:61143) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oj5uP-0006NS-MZ for qemu-devel@nongnu.org; Wed, 11 Aug 2010 03:39:33 -0400 From: Stefan Weil Date: Wed, 11 Aug 2010 09:38:54 +0200 Message-Id: <1281512334-4268-2-git-send-email-weil@mail.berlios.de> In-Reply-To: <1281512334-4268-1-git-send-email-weil@mail.berlios.de> References: <1281512334-4268-1-git-send-email-weil@mail.berlios.de> Subject: [Qemu-devel] [PATCH 2/2] ivshmem: Fix compilation without kvm List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: QEMU Developers Cc: Anthony Liguori , Cam Macdonell kvm_set_ioeventfd_mmio_long is only available with CONFIG_KVM. Cc: Anthony Liguori Cc: Cam Macdonell Signed-off-by: Stefan Weil --- 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