From patchwork Tue Jun 28 06:02:49 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Feng Yang X-Patchwork-Id: 923162 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 p5S64Y5T004075 for ; Tue, 28 Jun 2011 06:04:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756600Ab1F1GDB (ORCPT ); Tue, 28 Jun 2011 02:03:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27344 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756432Ab1F1GC6 (ORCPT ); Tue, 28 Jun 2011 02:02:58 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p5S62v7n001460 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 28 Jun 2011 02:02:57 -0400 Received: from fyang.redhat.com (dhcp-65-138.nay.redhat.com [10.66.65.138]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p5S62sa9015211; Tue, 28 Jun 2011 02:02:55 -0400 From: fyang@redhat.com To: autotest@test.kernel.org Cc: kvm@vger.kernel.org, Feng Yang Subject: [PATCH] KVM Test: Catch AttributeError and make screendump thread continue. Date: Tue, 28 Jun 2011 14:02:49 +0800 Message-Id: <1309240969-13614-1-git-send-email-fyang@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 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]); Tue, 28 Jun 2011 06:04:34 +0000 (UTC) From: Feng Yang screendump is start before vm creating. At most time, it is ok. But when setting start_vm to no, then create vm in tests script. This may could not work. screendump thread exit for AttributeError exception. Some of our unattended_install case fail for this reason. In order to fix this issue, we may: 1. catch AttributeError exception and make screendump thread continue. This way is easy fix, but if we do not need vm in a case, screendump thread will still alive, and print useless debug log. 2. start screendmup thread in vm.create(), then close it in vm.destroy(). This need more work and may bring other problem. This patch use first way. Please help comment it. Signed-off-by: Feng Yang --- client/virt/virt_env_process.py | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/client/virt/virt_env_process.py b/client/virt/virt_env_process.py index 1eb8ecf..ac3c6f1 100644 --- a/client/virt/virt_env_process.py +++ b/client/virt/virt_env_process.py @@ -433,6 +433,9 @@ def _take_screendumps(test, params, env): except kvm_monitor.MonitorError, e: logging.warn(e) continue + except AttributeError, e: + logging.warn(e) + continue if not os.path.exists(temp_filename): logging.warn("VM '%s' failed to produce a screendump", vm.name) continue