From patchwork Mon Jun 27 18:19:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kiszka X-Patchwork-Id: 922002 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p5RIKlgl001203 for ; Mon, 27 Jun 2011 18:20:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751737Ab1F0SUr (ORCPT ); Mon, 27 Jun 2011 14:20:47 -0400 Received: from fmmailgate02.web.de ([217.72.192.227]:60807 "EHLO fmmailgate02.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753346Ab1F0SUl (ORCPT ); Mon, 27 Jun 2011 14:20:41 -0400 Received: from smtp03.web.de ( [172.20.0.65]) by fmmailgate02.web.de (Postfix) with ESMTP id DDBE41A3CDFC1; Mon, 27 Jun 2011 20:20:29 +0200 (CEST) Received: from [2.204.233.154] (helo=localhost.localdomain) by smtp03.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #2) id 1QbGQ9-0007wf-00; Mon, 27 Jun 2011 20:20:29 +0200 From: Jan Kiszka To: Avi Kivity , Marcelo Tosatti Cc: kvm@vger.kernel.org, "Michael S. Tsirkin" , Alex Williamson Subject: [PATCH 07/13] pci-assign: Fix kvm_deassign_irq handling in assign_irq Date: Mon, 27 Jun 2011 20:19:50 +0200 Message-Id: X-Mailer: git-send-email 1.7.1 In-Reply-To: References: In-Reply-To: References: X-Sender: jan.kiszka@web.de X-Provags-ID: V01U2FsdGVkX19T8135TPBCMPMR7GlIslT1O37MV3PNfOifu1c/ et1XY+nqx1zbYRMeYEGZSqChJX5zq/UrP2FJ7LIUfh5rUyEyK8 Im2IfCxL0= Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Mon, 27 Jun 2011 18:20:50 +0000 (UTC) From: Jan Kiszka Always clear AssignedDevice::irq_requested_type after calling kvm_deassign_irq. Moreover, drop the obviously incorrect exclusion when reporting related errors - if irq_requested_type is non-zero, deassign must not fail. Signed-off-by: Jan Kiszka --- hw/device-assignment.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/device-assignment.c b/hw/device-assignment.c index 36ad6b0..36c0f5f 100644 --- a/hw/device-assignment.c +++ b/hw/device-assignment.c @@ -992,9 +992,10 @@ static int assign_irq(AssignedDevice *dev) if (dev->irq_requested_type) { assigned_irq_data.flags = dev->irq_requested_type; r = kvm_deassign_irq(kvm_state, &assigned_irq_data); - /* -ENXIO means no assigned irq */ - if (r && r != -ENXIO) + if (r) { perror("assign_irq: deassign"); + } + dev->irq_requested_type = 0; } assigned_irq_data.flags = KVM_DEV_IRQ_GUEST_INTX;