Received: from eggs.gnu.org ([2001:4830:134:3::10]:51508) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuH6r-0004FZ-Ql for qemu-devel@nongnu.org; Tue, 10 Jun 2014 04:08:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WuH6g-0008Lb-EJ for qemu-devel@nongnu.org; Tue, 10 Jun 2014 04:08:45 -0400 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:34394) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuH6g-0008LP-4e for qemu-devel@nongnu.org; Tue, 10 Jun 2014 04:08:34 -0400 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 10 Jun 2014 09:08:33 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 7E566219005F for ; Tue, 10 Jun 2014 09:08:20 +0100 (BST) Received: from d06av08.portsmouth.uk.ibm.com (d06av08.portsmouth.uk.ibm.com [9.149.37.249]) by b06cxnps4074.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id s5A88Voo27590878 for ; Tue, 10 Jun 2014 08:08:31 GMT Received: from d06av08.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av08.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id s5A88Uu5032673 for ; Tue, 10 Jun 2014 02:08:30 -0600 From: Cornelia Huck Date: Tue, 10 Jun 2014 10:08:16 +0200 Message-Id: <1402387705-13494-3-git-send-email-cornelia.huck@de.ibm.com> In-Reply-To: <1402387705-13494-1-git-send-email-cornelia.huck@de.ibm.com> References: <1402387705-13494-1-git-send-email-cornelia.huck@de.ibm.com> Subject: [Qemu-devel] [PULL 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: peter.maydell@linaro.org, agraf@suse.de, borntraeger@de.ibm.com, jfrei@linux.vnet.ibm.com, aliguori@amazon.com, Cornelia Huck 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