From: Lucas Meneghel Rodrigues Subject: [PATCH 06/13] KVM test: kvm_vm.py: redirect the serial console to a unix socket Date: Mon, 21 Jun 2010 22:52:18 -0300 Message-ID: <1277171545-23003-6-git-send-email-lmr@redhat.com> References: <1277171545-23003-1-git-send-email-lmr@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: autotest@test.kernel.org Return-path: In-Reply-To: <1277171545-23003-1-git-send-email-lmr@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: autotest-bounces@test.kernel.org Errors-To: autotest-bounces@test.kernel.org List-Id: kvm.vger.kernel.org From: Michael Goldish Based on Jason Wang's patch. Signed-off-by: Jason Wang Signed-off-by: Michael Goldish --- client/tests/kvm/kvm_vm.py | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index 225f26a..1edecb9 100755 --- a/client/tests/kvm/kvm_vm.py +++ b/client/tests/kvm/kvm_vm.py @@ -206,6 +206,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 @@ -314,6 +317,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": @@ -774,6 +780,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. -- 1.7.0.1