From patchwork Sun May 17 15:43:02 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anthony Liguori X-Patchwork-Id: 24314 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n4HFhXUg012983 for ; Sun, 17 May 2009 15:43:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753584AbZEQPn2 (ORCPT ); Sun, 17 May 2009 11:43:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754167AbZEQPn2 (ORCPT ); Sun, 17 May 2009 11:43:28 -0400 Received: from e1.ny.us.ibm.com ([32.97.182.141]:40273 "EHLO e1.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752208AbZEQPn1 (ORCPT ); Sun, 17 May 2009 11:43:27 -0400 Received: from d01relay02.pok.ibm.com (d01relay02.pok.ibm.com [9.56.227.234]) by e1.ny.us.ibm.com (8.13.1/8.13.1) with ESMTP id n4HFda2T024765 for ; Sun, 17 May 2009 11:39:36 -0400 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay02.pok.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n4HFhSUi154824 for ; Sun, 17 May 2009 11:43:28 -0400 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n4HFfR20030082 for ; Sun, 17 May 2009 11:41:28 -0400 Received: from localhost.localdomain (sig-9-65-8-189.mts.ibm.com [9.65.8.189]) by d01av02.pok.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id n4HFfPcN030035; Sun, 17 May 2009 11:41:26 -0400 From: Anthony Liguori To: kvm@vger.kernel.org Cc: Glauber Costa , Gleb Natapov , Avi Kivity , Anthony Liguori Subject: [PATCH 01/17] kvm: libkvm: protect irq injection status code with KVM_CAP_IRQ_INJECT_STATUS Date: Sun, 17 May 2009 10:43:02 -0500 Message-Id: <1242574999-20887-2-git-send-email-aliguori@us.ibm.com> X-Mailer: git-send-email 1.6.0.6 In-Reply-To: <1242574999-20887-1-git-send-email-aliguori@us.ibm.com> References: <1242574999-20887-1-git-send-email-aliguori@us.ibm.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Gleb Natapov Fixes builds with older kernel headers. Signed-off-by: Gleb Natapov Signed-off-by: Avi Kivity Signed-off-by: Anthony Liguori diff --git a/kvm/libkvm/libkvm.c b/kvm/libkvm/libkvm.c index 0ac1c28..7c65f31 100644 --- a/kvm/libkvm/libkvm.c +++ b/kvm/libkvm/libkvm.c @@ -667,9 +667,14 @@ int kvm_set_irq_level(kvm_context_t kvm, int irq, int level, int *status) if (r == -1) perror("kvm_set_irq_level"); - if (status) + if (status) { +#ifdef KVM_CAP_IRQ_INJECT_STATUS *status = (kvm->irqchip_inject_ioctl == KVM_IRQ_LINE) ? 1 : event.status; +#else + *status = 1; +#endif + } return 1; }