Received: from eggs.gnu.org ([2001:4830:134:3::10]:57510) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrpO7-0001lM-Ur for qemu-devel@nongnu.org; Tue, 03 Jun 2014 10:08:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WrpNv-0008Kx-Ot for qemu-devel@nongnu.org; Tue, 03 Jun 2014 10:08:27 -0400 Received: from e06smtp11.uk.ibm.com ([195.75.94.107]:57372) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WrpNv-0008Ka-Fm for qemu-devel@nongnu.org; Tue, 03 Jun 2014 10:08:15 -0400 Received: from /spool/local by e06smtp11.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 3 Jun 2014 15:08:14 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 4027417D8063 for ; Tue, 3 Jun 2014 15:09:31 +0100 (BST) Received: from d06av09.portsmouth.uk.ibm.com (d06av09.portsmouth.uk.ibm.com [9.149.37.250]) by b06cxnps3074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s53E8DnS25165992 for ; Tue, 3 Jun 2014 14:08:13 GMT Received: from d06av09.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av09.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s53E8CRn022861 for ; Tue, 3 Jun 2014 08:08:13 -0600 From: Cornelia Huck Date: Tue, 3 Jun 2014 16:07:57 +0200 Message-Id: <1401804485-14801-3-git-send-email-cornelia.huck@de.ibm.com> In-Reply-To: <1401804485-14801-1-git-send-email-cornelia.huck@de.ibm.com> References: <1401804485-14801-1-git-send-email-cornelia.huck@de.ibm.com> Subject: [Qemu-devel] [PATCH 02/10] s390x/kvm: make flic play well with old kernels List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Cornelia Huck , borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, agraf@suse.de If we run with an old kernel that does not support KVM_CAP_IRQ_ROUTING, we don't have to do anything in the ->register_io_adapter and ->io_adapter_map callbacks and therefore should return 0 instead of -ENOSYS (just as the non-kvm flic does). This fixes using adapter interrupts when running under an older kernel, which broke with "s390x: add I/O adapter registration". Reported-by: Christian Borntraeger Signed-off-by: Cornelia Huck --- hw/intc/s390_flic_kvm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/intc/s390_flic_kvm.c b/hw/intc/s390_flic_kvm.c index 46c9e61..a734094 100644 --- a/hw/intc/s390_flic_kvm.c +++ b/hw/intc/s390_flic_kvm.c @@ -170,7 +170,8 @@ static int kvm_s390_register_io_adapter(S390FLICState *fs, uint32_t id, }; if (!kvm_check_extension(kvm_state, KVM_CAP_IRQ_ROUTING)) { - return -ENOSYS; + /* nothing to do */ + return 0; } r = ioctl(flic->fd, KVM_SET_DEVICE_ATTR, &attr); @@ -195,7 +196,8 @@ static int kvm_s390_io_adapter_map(S390FLICState *fs, uint32_t id, int r; if (!kvm_check_extension(kvm_state, KVM_CAP_IRQ_ROUTING)) { - return -ENOSYS; + /* nothing to do */ + return 0; } r = ioctl(flic->fd, KVM_SET_DEVICE_ATTR, &attr); -- 1.7.9.5