From patchwork Fri Jun 28 07:47:32 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 255287 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 3D7952C0380 for ; Fri, 28 Jun 2013 17:48:12 +1000 (EST) Received: from localhost ([::1]:35692 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsTPd-0007fE-Gn for incoming@patchwork.ozlabs.org; Fri, 28 Jun 2013 03:48:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60681) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsTPO-0007f9-Se for qemu-devel@nongnu.org; Fri, 28 Jun 2013 03:47:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UsTPN-0003se-O1 for qemu-devel@nongnu.org; Fri, 28 Jun 2013 03:47:54 -0400 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:40646) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UsTPN-0003s9-FC for qemu-devel@nongnu.org; Fri, 28 Jun 2013 03:47:53 -0400 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 28 Jun 2013 08:43:38 +0100 Received: from d06dlp03.portsmouth.uk.ibm.com (9.149.20.15) by e06smtp13.uk.ibm.com (192.168.101.143) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 28 Jun 2013 08:43:36 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp03.portsmouth.uk.ibm.com (Postfix) with ESMTP id EEA0F1B08066 for ; Fri, 28 Jun 2013 08:47:46 +0100 (BST) Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by b06cxnps3074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r5S7lUGN52232406 for ; Fri, 28 Jun 2013 07:47:30 GMT Received: from d06av02.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id r5S7ldKK002981 for ; Fri, 28 Jun 2013 01:47:40 -0600 Received: from gondolin.boeblingen.de.ibm.com (dyn-9-152-224-218.boeblingen.de.ibm.com [9.152.224.218]) by d06av02.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id r5S7ld1l002955; Fri, 28 Jun 2013 01:47:39 -0600 From: Cornelia Huck To: Paolo Bonzini , Stefan Weil Date: Fri, 28 Jun 2013 09:47:32 +0200 Message-Id: <1372405652-23244-1-git-send-email-cornelia.huck@de.ibm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <51CD3321.3040907@redhat.com> References: <51CD3321.3040907@redhat.com> X-TM-AS-MML: No X-Content-Scanned: Fidelis XPS MAILER x-cbid: 13062807-2966-0000-0000-000007FFEB3D X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 195.75.94.109 Cc: Blue Swirl , Cornelia Huck , Anthony Liguori , qemu-devel , =?UTF-8?q?Aur=C3=A9lien=20Jarno?= Subject: [Qemu-devel] [PATCH] virtio-ccw: fix build breakage on windows X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org event_notifier_get_fd() is not available on windows hosts. Fix this by moving the calls to event_notifier_get_fd() to the kvm code. Reported-by: Stefan Weil Signed-off-by: Cornelia Huck Reviewed-by: Paolo Bonzini --- hw/s390x/virtio-ccw.c | 6 ++---- target-s390x/cpu.h | 11 +++++++---- target-s390x/kvm.c | 5 +++-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c index faef5dd..e744957 100644 --- a/hw/s390x/virtio-ccw.c +++ b/hw/s390x/virtio-ccw.c @@ -79,8 +79,7 @@ static int virtio_ccw_set_guest2host_notifier(VirtioCcwDevice *dev, int n, return r; } virtio_queue_set_host_notifier_fd_handler(vq, true, set_handler); - r = s390_assign_subch_ioeventfd(event_notifier_get_fd(notifier), sch_id, - n, assign); + r = s390_assign_subch_ioeventfd(notifier, sch_id, n, assign); if (r < 0) { error_report("%s: unable to assign ioeventfd: %d", __func__, r); virtio_queue_set_host_notifier_fd_handler(vq, false, false); @@ -89,8 +88,7 @@ static int virtio_ccw_set_guest2host_notifier(VirtioCcwDevice *dev, int n, } } else { virtio_queue_set_host_notifier_fd_handler(vq, false, false); - s390_assign_subch_ioeventfd(event_notifier_get_fd(notifier), sch_id, - n, assign); + s390_assign_subch_ioeventfd(notifier, sch_id, n, assign); event_notifier_cleanup(notifier); } return r; diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h index 918c819..741c4e4 100644 --- a/target-s390x/cpu.h +++ b/target-s390x/cpu.h @@ -1081,7 +1081,8 @@ void kvm_s390_io_interrupt(S390CPU *cpu, uint16_t subchannel_id, void kvm_s390_crw_mchk(S390CPU *cpu); void kvm_s390_enable_css_support(S390CPU *cpu); int kvm_s390_get_registers_partial(CPUState *cpu); -int kvm_s390_assign_subch_ioeventfd(int fd, uint32_t sch, int vq, bool assign); +int kvm_s390_assign_subch_ioeventfd(EventNotifier *notifier, uint32_t sch, + int vq, bool assign); #else static inline void kvm_s390_io_interrupt(S390CPU *cpu, uint16_t subchannel_id, @@ -1100,7 +1101,8 @@ static inline int kvm_s390_get_registers_partial(CPUState *cpu) { return -ENOSYS; } -static inline int kvm_s390_assign_subch_ioeventfd(int fd, uint32_t sch, int vq, +static inline int kvm_s390_assign_subch_ioeventfd(EventNotifier *notifier, + uint32_t sch, int vq, bool assign) { return -ENOSYS; @@ -1131,11 +1133,12 @@ static inline void s390_crw_mchk(S390CPU *cpu) } } -static inline int s390_assign_subch_ioeventfd(int fd, uint32_t sch_id, int vq, +static inline int s390_assign_subch_ioeventfd(EventNotifier *notifier, + uint32_t sch_id, int vq, bool assign) { if (kvm_enabled()) { - return kvm_s390_assign_subch_ioeventfd(fd, sch_id, vq, assign); + return kvm_s390_assign_subch_ioeventfd(notifier, sch_id, vq, assign); } else { return -ENOSYS; } diff --git a/target-s390x/kvm.c b/target-s390x/kvm.c index 650d3a5..d8e5c6f 100644 --- a/target-s390x/kvm.c +++ b/target-s390x/kvm.c @@ -933,12 +933,13 @@ void kvm_arch_init_irq_routing(KVMState *s) { } -int kvm_s390_assign_subch_ioeventfd(int fd, uint32_t sch, int vq, bool assign) +int kvm_s390_assign_subch_ioeventfd(EventNotifier *notifier, uint32_t sch, + int vq, bool assign) { struct kvm_ioeventfd kick = { .flags = KVM_IOEVENTFD_FLAG_VIRTIO_CCW_NOTIFY | KVM_IOEVENTFD_FLAG_DATAMATCH, - .fd = fd, + .fd = event_notifier_get_fd(notifier), .datamatch = vq, .addr = sch, .len = 8,