From patchwork Sun Jul 5 18:27:58 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 34169 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 n65IT3Au011151 for ; Sun, 5 Jul 2009 18:29:03 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753382AbZGES2d (ORCPT ); Sun, 5 Jul 2009 14:28:33 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753375AbZGES2d (ORCPT ); Sun, 5 Jul 2009 14:28:33 -0400 Received: from mx2.redhat.com ([66.187.237.31]:33540 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752554AbZGES2c (ORCPT ); Sun, 5 Jul 2009 14:28:32 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n65ISb6s003761 for ; Sun, 5 Jul 2009 14:28:37 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n65ISaIB023779; Sun, 5 Jul 2009 14:28:36 -0400 Received: from redhat.com (vpn-6-131.tlv.redhat.com [10.35.6.131]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n65ISXAf022162; Sun, 5 Jul 2009 14:28:34 -0400 Date: Sun, 5 Jul 2009 21:27:58 +0300 From: "Michael S. Tsirkin" To: avi@redhat.com, kvm@vger.kernel.org Subject: [PATCH] kvm: fail msi request if !level Message-ID: <20090705182758.GA3109@redhat.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.19 (2009-01-05) X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Irqfd sets level for interrupt to 1 and then to 0. For MSI, check level so that a single message is sent. Signed-off-by: Michael S. Tsirkin --- virt/kvm/irq_comm.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/virt/kvm/irq_comm.c b/virt/kvm/irq_comm.c index c380bf0..7af18b8 100644 --- a/virt/kvm/irq_comm.c +++ b/virt/kvm/irq_comm.c @@ -139,7 +139,9 @@ int kvm_set_irq(struct kvm *kvm, int irq_source_id, int irq, int level) else clear_bit(irq_source_id, irq_state); sig_level = !!(*irq_state); - } else /* Deal with MSI/MSI-X */ + } else if (!level) + return ret; + else /* Deal with MSI/MSI-X */ sig_level = 1; /* Not possible to detect if the guest uses the PIC or the