From patchwork Tue Jun 9 00:34:48 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas Meneghel Rodrigues X-Patchwork-Id: 28780 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n590Z13Z011546 for ; Tue, 9 Jun 2009 00:35:01 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754626AbZFIAe5 (ORCPT ); Mon, 8 Jun 2009 20:34:57 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754561AbZFIAe5 (ORCPT ); Mon, 8 Jun 2009 20:34:57 -0400 Received: from mx2.redhat.com ([66.187.237.31]:43864 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753344AbZFIAe4 (ORCPT ); Mon, 8 Jun 2009 20:34:56 -0400 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n590Yw7C000370; Mon, 8 Jun 2009 20:34:58 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n590Yv2s010951; Mon, 8 Jun 2009 20:34:58 -0400 Received: from localhost.localdomain (vpn-10-92.bos.redhat.com [10.16.10.92]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n590Yqdq011766; Mon, 8 Jun 2009 20:34:56 -0400 From: Lucas Meneghel Rodrigues To: autotest@test.kernel.org Cc: kvm@vger.kernel.org, Lucas Meneghel Rodrigues , Michael Goldish Subject: [KVM-AUTOTEST PATCH 03/06] kvm_vm.py: add new VM parameter 'x11_display' that controls $DISPLAY Date: Mon, 8 Jun 2009 21:34:48 -0300 Message-Id: <1244507691-9575-3-git-send-email-lmr@redhat.com> In-Reply-To: <1244507691-9575-2-git-send-email-lmr@redhat.com> References: <1244507691-9575-1-git-send-email-lmr@redhat.com> <1244507691-9575-2-git-send-email-lmr@redhat.com> X-Scanned-By: MIMEDefang 2.58 on 172.16.27.26 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org If x11_display is specified, the DISPLAY environment variable is set to this value for the QEMU process. This may be useful for SDL rendering. Also add some comments. Signed-off-by: Michael Goldish --- client/tests/kvm/kvm_vm.py | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index e2b684c..6de3989 100644 --- a/client/tests/kvm/kvm_vm.py +++ b/client/tests/kvm/kvm_vm.py @@ -196,6 +196,9 @@ class VM: (iso_dir is pre-pended to the ISO filename) extra_params -- a string to append to the qemu command ssh_port -- should be 22 for SSH, 23 for Telnet + x11_display -- if specified, the DISPLAY environment variable + will be be set to this value for the qemu process (useful for + SDL rendering) images -- a list of image object names, separated by spaces nics -- a list of NIC object names, separated by spaces @@ -222,8 +225,16 @@ class VM: if iso_dir == None: iso_dir = self.iso_dir - qemu_cmd = qemu_path + # Start constructing the qemu command + qemu_cmd = "" + # Set the X11 display parameter if requested + if params.get("x11_display"): + qemu_cmd += "DISPLAY=%s " % params.get("x11_display") + # Add the qemu binary + qemu_cmd += qemu_path + # Add the VM's name qemu_cmd += " -name '%s'" % name + # Add the monitor socket parameter qemu_cmd += " -monitor unix:%s,server,nowait" % self.monitor_file_name for image_name in kvm_utils.get_sub_dict_names(params, "images"):