From patchwork Fri Apr 16 18:12:26 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Meneghel Rodrigues X-Patchwork-Id: 93183 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 o3GICYk5006979 for ; Fri, 16 Apr 2010 18:12:35 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757605Ab0DPSMd (ORCPT ); Fri, 16 Apr 2010 14:12:33 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13429 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755177Ab0DPSMc (ORCPT ); Fri, 16 Apr 2010 14:12:32 -0400 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3GICVEr021484 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 16 Apr 2010 14:12:31 -0400 Received: from localhost.localdomain (vpn-9-143.rdu.redhat.com [10.11.9.143]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o3GICTiB008758; Fri, 16 Apr 2010 14:12:29 -0400 From: Lucas Meneghel Rodrigues To: autotest@test.kernel.org Cc: kvm@vger.kernel.org, Lucas Meneghel Rodrigues Subject: [PATCH] KVM test: Silence screendump thread by default Date: Fri, 16 Apr 2010 15:12:26 -0300 Message-Id: <1271441546-20407-1-git-send-email-lmr@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 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]); Fri, 16 Apr 2010 18:12:43 +0000 (UTC) diff --git a/client/tests/kvm/kvm_preprocessing.py b/client/tests/kvm/kvm_preprocessing.py index 50db65c..4b9290c 100644 --- a/client/tests/kvm/kvm_preprocessing.py +++ b/client/tests/kvm/kvm_preprocessing.py @@ -401,6 +401,10 @@ def _take_screendumps(test, params, env): kvm_utils.generate_random_string(6)) delay = float(params.get("screendump_delay", 5)) quality = int(params.get("screendump_quality", 30)) + if params.get("screendump_verbose") == 'yes': + screendump_verbose = True + else: + screendump_verbose = False cache = {} @@ -408,7 +412,11 @@ def _take_screendumps(test, params, env): for vm in kvm_utils.env_get_all_vms(env): if vm.is_dead(): continue - vm.send_monitor_cmd("screendump %s" % temp_filename) + if screendump_verbose: + vm.send_monitor_cmd("screendump %s" % temp_filename) + else: + vm.send_monitor_cmd("screendump %s" % temp_filename, + verbose=False) if not os.path.exists(temp_filename): logging.warn("VM '%s' failed to produce a screendump", vm.name) continue diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index 047505a..244355e 100755 --- a/client/tests/kvm/kvm_vm.py +++ b/client/tests/kvm/kvm_vm.py @@ -498,7 +498,7 @@ class VM: lockfile.close() - def send_monitor_cmd(self, command, block=True, timeout=20.0): + def send_monitor_cmd(self, command, block=True, timeout=20.0, verbose=True): """ Send command to the QEMU monitor. @@ -541,8 +541,11 @@ class VM: time.sleep(0.01) return (False, o) + # In certain conditions printing this debug output might be too much + # Just print it if verbose is enabled (True by default) + if verbose: + logging.debug("Sending monitor command: %s" % command) # Connect to monitor - logging.debug("Sending monitor command: %s" % command) try: s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) s.setblocking(False) diff --git a/client/tests/kvm/tests_base.cfg.sample b/client/tests/kvm/tests_base.cfg.sample index 4baa1dc..e74c7cb 100644 --- a/client/tests/kvm/tests_base.cfg.sample +++ b/client/tests/kvm/tests_base.cfg.sample @@ -23,6 +23,7 @@ keep_screendumps_on_error = yes screendump_delay = 5 screendump_quality = 30 screendump_temp_dir = /dev/shm +screendump_verbose = no # Some default VM params qemu_binary = qemu