From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Williamson Subject: [PATCH] kvm: Don't abort on kvm_irqchip_add_msi_route() Date: Mon, 25 Jun 2012 09:40:39 -0600 Message-ID: <20120625154024.3598.7168.stgit@bling.home> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: qemu-devel@nongnu.org To: avi@redhat.com, kvm@vger.kernel.org, mtosatti@redhat.com, jan.kiszka@siemens.com Return-path: Received: from mx1.redhat.com ([209.132.183.28]:37625 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753820Ab2FYPkn (ORCPT ); Mon, 25 Jun 2012 11:40:43 -0400 Sender: kvm-owner@vger.kernel.org List-ID: Anyone using these functions has to be prepared that irqchip support may not be present. It shouldn't be up to the core code to determine whether this is a fatal error. Currently code written as: virq = kvm_irqchip_add_msi_route(...) if (virq < 0) { } else { } works on x86 with and without kvm irqchip enabled, works without kvm support compiled in, but aborts() on !x86 with kvm support. Signed-off-by: Alex Williamson --- kvm-all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kvm-all.c b/kvm-all.c index 45d00cd..b2ed702 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -1146,7 +1146,7 @@ int kvm_irqchip_send_msi(KVMState *s, MSIMessage msg) int kvm_irqchip_add_msi_route(KVMState *s, MSIMessage msg) { - abort(); + return -ENOSYS; } static int kvm_irqchip_assign_irqfd(KVMState *s, int fd, int virq, bool assign)