From patchwork Wed Aug 15 11:08:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 1325341 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 3A76B3FC66 for ; Wed, 15 Aug 2012 11:08:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751691Ab2HOLIZ (ORCPT ); Wed, 15 Aug 2012 07:08:25 -0400 Received: from mnementh.archaic.org.uk ([81.2.115.146]:51545 "EHLO mnementh.archaic.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751109Ab2HOLIY (ORCPT ); Wed, 15 Aug 2012 07:08:24 -0400 Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.72) (envelope-from ) id 1T1bSP-0000cx-BX; Wed, 15 Aug 2012 12:08:13 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Avi Kivity , Marcelo Tosatti , Jan Kiszka , kvm@vger.kernel.org Subject: [PATCH v2] kvm-all.c: Move init of irqchip_inject_ioctl out of kvm_irqchip_create() Date: Wed, 15 Aug 2012 12:08:13 +0100 Message-Id: <1345028893-2388-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.2.5 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Move the init of the irqchip_inject_ioctl field of KVMState out of kvm_irqchip_create() and into kvm_init(), so that kvm_set_irq() can be used even when no irqchip is created (for architectures that support async interrupt notification even without an in kernel irqchip). Signed-off-by: Peter Maydell --- Changes v1->v2: move whe whole chunk of init code, for both KVM_IRQ_LINE and KVM_IRQ_LINE_STATUS possibilities. kvm-all.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 34b02c1..72d84a2 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -1200,10 +1200,6 @@ static int kvm_irqchip_create(KVMState *s) return ret; } - s->irqchip_inject_ioctl = KVM_IRQ_LINE; - if (kvm_check_extension(s, KVM_CAP_IRQ_INJECT_STATUS)) { - s->irqchip_inject_ioctl = KVM_IRQ_LINE_STATUS; - } kvm_kernel_irqchip = true; /* If we have an in-kernel IRQ chip then we must have asynchronous * interrupt delivery (though the reverse is not necessarily true) @@ -1350,6 +1346,11 @@ int kvm_init(void) s->direct_msi = (kvm_check_extension(s, KVM_CAP_SIGNAL_MSI) > 0); #endif + s->irqchip_inject_ioctl = KVM_IRQ_LINE; + if (kvm_check_extension(s, KVM_CAP_IRQ_INJECT_STATUS)) { + s->irqchip_inject_ioctl = KVM_IRQ_LINE_STATUS; + } + ret = kvm_arch_init(s); if (ret < 0) { goto err;