From patchwork Fri Feb 13 09:49:10 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Han, Weidong" X-Patchwork-Id: 6974 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 n1D9nHt4002823 for ; Fri, 13 Feb 2009 09:49:17 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751089AbZBMJtQ (ORCPT ); Fri, 13 Feb 2009 04:49:16 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751460AbZBMJtP (ORCPT ); Fri, 13 Feb 2009 04:49:15 -0500 Received: from mga03.intel.com ([143.182.124.21]:45533 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751089AbZBMJtP (ORCPT ); Fri, 13 Feb 2009 04:49:15 -0500 Received: from azsmga001.ch.intel.com ([10.2.17.19]) by azsmga101.ch.intel.com with ESMTP; 13 Feb 2009 01:49:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.38,201,1233561600"; d="scan'208,223";a="110339151" Received: from azsmsx602.amr.corp.intel.com ([10.2.121.201]) by azsmga001.ch.intel.com with ESMTP; 13 Feb 2009 01:49:14 -0800 Received: from pdsmsx601.ccr.corp.intel.com (172.16.12.94) by azsmsx602.amr.corp.intel.com (10.2.121.201) with Microsoft SMTP Server (TLS) id 8.1.311.2; Fri, 13 Feb 2009 02:49:13 -0700 Received: from pdsmsx503.ccr.corp.intel.com ([172.16.12.95]) by pdsmsx601.ccr.corp.intel.com ([172.16.12.94]) with mapi; Fri, 13 Feb 2009 17:49:12 +0800 From: "Han, Weidong" To: "'Avi Kivity'" CC: "'kvm@vger.kernel.org'" , "'Mark McLoughlin'" Date: Fri, 13 Feb 2009 17:49:10 +0800 Subject: [PATCH 2/7] [V3] kvm: fix kvm_vm_ioctl_deassign_device Thread-Topic: [PATCH 2/7] [V3] kvm: fix kvm_vm_ioctl_deassign_device Thread-Index: AcmNwFIyzBTjw4/uRqy+YSyRm1vjtg== Message-ID: <715D42877B251141A38726ABF5CABF2C01959AFEB7@pdsmsx503.ccr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org only need to set assigned_dev_id for deassignment, use match->flags to judge and deassign it. Acked-by: Mark McLoughlin Signed-off-by: Weidong Han --- virt/kvm/kvm_main.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index ef52622..3aacdb9 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -574,7 +574,7 @@ static int kvm_vm_ioctl_deassign_device(struct kvm *kvm, goto out; } - if (assigned_dev->flags & KVM_DEV_ASSIGN_ENABLE_IOMMU) + if (match->flags & KVM_DEV_ASSIGN_ENABLE_IOMMU) kvm_deassign_device(kvm, match); kvm_free_assigned_device(kvm, match);