From patchwork Wed Feb 3 11:21:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Goldish X-Patchwork-Id: 76690 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o13BMout024550 for ; Wed, 3 Feb 2010 11:22:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755262Ab0BCLWs (ORCPT ); Wed, 3 Feb 2010 06:22:48 -0500 Received: from mx1.redhat.com ([209.132.183.28]:14945 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754940Ab0BCLWs (ORCPT ); Wed, 3 Feb 2010 06:22:48 -0500 Received: from int-mx03.intmail.prod.int.phx2.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o13BMkn0021249 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 3 Feb 2010 06:22:46 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o13BMkwx032032; Wed, 3 Feb 2010 06:22:46 -0500 Received: from localhost.localdomain (dhcp-1-188.tlv.redhat.com [10.35.1.188]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id o13BMiVf016106; Wed, 3 Feb 2010 06:22:44 -0500 From: Michael Goldish To: autotest@test.kernel.org, kvm@vger.kernel.org Cc: Michael Goldish Subject: [KVM-AUTOTEST PATCH 1/1] KVM test: kvm_vm.py: shorten VM.destroy() Date: Wed, 3 Feb 2010 13:21:12 +0200 Message-Id: <1265196072-14395-1-git-send-email-mgoldish@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 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.3 (demeter.kernel.org [140.211.167.41]); Wed, 03 Feb 2010 11:22:50 +0000 (UTC) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index 6731927..db903a0 100755 --- a/client/tests/kvm/kvm_vm.py +++ b/client/tests/kvm/kvm_vm.py @@ -598,8 +598,6 @@ class VM: # Is it already dead? if self.is_dead(): logging.debug("VM is already down") - if self.pci_assignable: - self.pci_assignable.release_devs() return logging.debug("Destroying VM with PID %d..." % @@ -620,9 +618,6 @@ class VM: return finally: session.close() - if self.pci_assignable: - self.pci_assignable.release_devs() - # Try to destroy with a monitor command logging.debug("Trying to kill VM with monitor command...") @@ -632,8 +627,6 @@ class VM: # Wait for the VM to be really dead if kvm_utils.wait_for(self.is_dead, 5, 0.5, 0.5): logging.debug("VM is down") - if self.pci_assignable: - self.pci_assignable.release_devs() return # If the VM isn't dead yet... @@ -643,13 +636,13 @@ class VM: # Wait for the VM to be really dead if kvm_utils.wait_for(self.is_dead, 5, 0.5, 0.5): logging.debug("VM is down") - if self.pci_assignable: - self.pci_assignable.release_devs() return logging.error("Process %s is a zombie!" % self.process.get_pid()) finally: + if self.pci_assignable: + self.pci_assignable.release_devs() if self.process: self.process.close() try: