From patchwork Fri Jun 18 00:14:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Goldish X-Patchwork-Id: 106780 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 o5I0FQrF015992 for ; Fri, 18 Jun 2010 00:15:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760924Ab0FRAPV (ORCPT ); Thu, 17 Jun 2010 20:15:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:4871 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760005Ab0FRAPL (ORCPT ); Thu, 17 Jun 2010 20:15:11 -0400 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 o5I0FAnT005909 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 17 Jun 2010 20:15:10 -0400 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 o5I0F7Nm005548; Thu, 17 Jun 2010 20:15:08 -0400 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 o5I0EljU005733; Thu, 17 Jun 2010 20:15:06 -0400 From: Michael Goldish To: autotest@test.kernel.org, kvm@vger.kernel.org Cc: Michael Goldish , Jason Wang Subject: [KVM-AUTOTEST PATCH 14/18] KVM test: kvm_vm.py: redirect the serial console to a unix socket Date: Fri, 18 Jun 2010 03:14:31 +0300 Message-Id: <1276820075-31310-14-git-send-email-mgoldish@redhat.com> In-Reply-To: <1276820075-31310-13-git-send-email-mgoldish@redhat.com> References: <1276820075-31310-1-git-send-email-mgoldish@redhat.com> <1276820075-31310-2-git-send-email-mgoldish@redhat.com> <1276820075-31310-3-git-send-email-mgoldish@redhat.com> <1276820075-31310-4-git-send-email-mgoldish@redhat.com> <1276820075-31310-5-git-send-email-mgoldish@redhat.com> <1276820075-31310-6-git-send-email-mgoldish@redhat.com> <1276820075-31310-7-git-send-email-mgoldish@redhat.com> <1276820075-31310-8-git-send-email-mgoldish@redhat.com> <1276820075-31310-9-git-send-email-mgoldish@redhat.com> <1276820075-31310-10-git-send-email-mgoldish@redhat.com> <1276820075-31310-11-git-send-email-mgoldish@redhat.com> <1276820075-31310-12-git-send-email-mgoldish@redhat.com> <1276820075-31310-13-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.3 (demeter.kernel.org [140.211.167.41]); Fri, 18 Jun 2010 00:15:27 +0000 (UTC) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index c82226d..5012d66 100755 --- a/client/tests/kvm/kvm_vm.py +++ b/client/tests/kvm/kvm_vm.py @@ -203,6 +203,9 @@ class VM: def add_qmp_monitor(help, filename): return " -qmp unix:'%s',server,nowait" % filename + def add_serial(help, filename): + return " -serial unix:'%s',server,nowait" % filename + def add_mem(help, mem): return " -m %s" % mem @@ -313,6 +316,9 @@ class VM: else: qemu_cmd += add_human_monitor(help, monitor_filename) + # Add serial console redirection + qemu_cmd += add_serial(help, self.get_serial_console_filename()) + for image_name in kvm_utils.get_sub_dict_names(params, "images"): image_params = kvm_utils.get_sub_dict(params, image_name) if image_params.get("boot_drive") == "no": @@ -772,6 +778,13 @@ class VM: kvm_utils.get_sub_dict_names(self.params, "monitors")] + def get_serial_console_filename(self): + """ + Return the serial console filename. + """ + return "/tmp/serial-%s" % self.instance + + def get_testlog_filename(self): """ Return the testlog filename.