From patchwork Tue Jan 11 18:33:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Goldish X-Patchwork-Id: 472251 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p0BIWs36011637 for ; Tue, 11 Jan 2011 18:32:55 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756195Ab1AKScv (ORCPT ); Tue, 11 Jan 2011 13:32:51 -0500 Received: from mx1.redhat.com ([209.132.183.28]:5126 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752777Ab1AKScv (ORCPT ); Tue, 11 Jan 2011 13:32:51 -0500 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p0BIWoeE005548 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 11 Jan 2011 13:32:50 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p0BIWntZ016410; Tue, 11 Jan 2011 13:32:50 -0500 Received: from qu0061.eng.lab.tlv.redhat.com ([10.35.16.61]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p0BIWmpR024581; Tue, 11 Jan 2011 13:32:48 -0500 From: Michael Goldish To: autotest@test.kernel.org, kvm@vger.kernel.org Cc: Michael Goldish Subject: [KVM-AUTOTEST PATCH 1/4] KVM test: kvm_vm.py: add status and output to VMDeadError Date: Tue, 11 Jan 2011 20:33:19 +0200 Message-Id: <1294770802-1501-1-git-send-email-mgoldish@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 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 (demeter1.kernel.org [140.211.167.41]); Tue, 11 Jan 2011 18:32:55 +0000 (UTC) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index 0403569..a69a191 100755 --- a/client/tests/kvm/kvm_vm.py +++ b/client/tests/kvm/kvm_vm.py @@ -86,7 +86,14 @@ class VMKVMInitError(VMPostCreateError): class VMDeadError(VMError): - pass + def __init__(self, status, output): + VMError.__init__(self, status, output) + self.status = status + self.output = output + + def __str__(self): + return ("VM process is dead (status: %s, output: %r)" % + (self.status, self.output)) class VMAddressError(VMError): @@ -1016,7 +1023,8 @@ class VM: @raise: Various monitor exceptions if the monitor is unresponsive """ if self.is_dead(): - raise VMDeadError("VM is dead") + raise VMDeadError(self.process.get_status(), + self.process.get_output()) if self.monitors: self.monitor.verify_responsive()