From patchwork Mon Jun 25 15:40:39 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Williamson X-Patchwork-Id: 167140 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id AEA07B6FA9 for ; Tue, 26 Jun 2012 01:41:05 +1000 (EST) Received: from localhost ([::1]:49513 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SjBPT-0003VR-K2 for incoming@patchwork.ozlabs.org; Mon, 25 Jun 2012 11:41:03 -0400 Received: from eggs.gnu.org ([208.118.235.92]:37242) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SjBPI-0003Qv-DR for qemu-devel@nongnu.org; Mon, 25 Jun 2012 11:40:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SjBP7-0008Fq-Si for qemu-devel@nongnu.org; Mon, 25 Jun 2012 11:40:51 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44321) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SjBP7-0008FZ-Ig for qemu-devel@nongnu.org; Mon, 25 Jun 2012 11:40:41 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q5PFeder003672 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 25 Jun 2012 11:40:40 -0400 Received: from bling.home (ovpn-113-149.phx2.redhat.com [10.3.113.149]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q5PFeddR027154; Mon, 25 Jun 2012 11:40:39 -0400 From: Alex Williamson To: avi@redhat.com, kvm@vger.kernel.org, mtosatti@redhat.com, jan.kiszka@siemens.com Date: Mon, 25 Jun 2012 09:40:39 -0600 Message-ID: <20120625154024.3598.7168.stgit@bling.home> User-Agent: StGIT/0.14.3 MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH] kvm: Don't abort on kvm_irqchip_add_msi_route() 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 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 Acked-by: Jan Kiszka --- 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)