From patchwork Sun Jun 13 14:33:39 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Goldish X-Patchwork-Id: 105821 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 o5DEYeUl027086 for ; Sun, 13 Jun 2010 14:34:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753897Ab0FMOef (ORCPT ); Sun, 13 Jun 2010 10:34:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44005 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753759Ab0FMOeS (ORCPT ); Sun, 13 Jun 2010 10:34:18 -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 o5DEYHun013067 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Sun, 13 Jun 2010 10:34:17 -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 o5DEYH9f004567; Sun, 13 Jun 2010 10:34:17 -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 o5DEY6v3030030; Sun, 13 Jun 2010 10:34:16 -0400 From: Michael Goldish To: autotest@test.kernel.org, kvm@vger.kernel.org Cc: Michael Goldish Subject: [KVM-AUTOTEST PATCH 08/14] KVM test: kvm_vm.py: use shell quoting in make_qemu_command() where appropriate Date: Sun, 13 Jun 2010 17:33:39 +0300 Message-Id: <1276439625-32472-8-git-send-email-mgoldish@redhat.com> In-Reply-To: <1276439625-32472-7-git-send-email-mgoldish@redhat.com> References: <1276439625-32472-1-git-send-email-mgoldish@redhat.com> <1276439625-32472-2-git-send-email-mgoldish@redhat.com> <1276439625-32472-3-git-send-email-mgoldish@redhat.com> <1276439625-32472-4-git-send-email-mgoldish@redhat.com> <1276439625-32472-5-git-send-email-mgoldish@redhat.com> <1276439625-32472-6-git-send-email-mgoldish@redhat.com> <1276439625-32472-7-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]); Sun, 13 Jun 2010 14:34:41 +0000 (UTC) diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py index 039fbff..e40abb4 100755 --- a/client/tests/kvm/kvm_vm.py +++ b/client/tests/kvm/kvm_vm.py @@ -204,7 +204,7 @@ class VM: return " -name '%s'" % name def add_unix_socket_monitor(help, filename): - return " -monitor unix:%s,server,nowait" % filename + return " -monitor unix:'%s',server,nowait" % filename def add_mem(help, mem): return " -m %s" % mem @@ -214,18 +214,18 @@ class VM: def add_cdrom(help, filename, index=2): if has_option(help, "drive"): - return " -drive file=%s,index=%d,media=cdrom" % (filename, - index) + return " -drive file='%s',index=%d,media=cdrom" % (filename, + index) else: - return " -cdrom %s" % filename + return " -cdrom '%s'" % filename def add_drive(help, filename, format=None, cache=None, werror=None, serial=None, snapshot=False, boot=False): - cmd = " -drive file=%s" % filename + cmd = " -drive file='%s'" % filename if format: cmd += ",if=%s" % format if cache: cmd += ",cache=%s" % cache if werror: cmd += ",werror=%s" % werror - if serial: cmd += ",serial=%s" % serial + if serial: cmd += ",serial='%s'" % serial if snapshot: cmd += ",snapshot=on" if boot: cmd += ",boot=on" return cmd @@ -233,23 +233,23 @@ class VM: def add_nic(help, vlan, model=None, mac=None): cmd = " -net nic,vlan=%d" % vlan if model: cmd += ",model=%s" % model - if mac: cmd += ",macaddr=%s" % mac + if mac: cmd += ",macaddr='%s'" % mac return cmd def add_net(help, vlan, mode, ifname=None, script=None, downscript=None): cmd = " -net %s,vlan=%d" % (mode, vlan) if mode == "tap": - if ifname: cmd += ",ifname=%s" % ifname - if script: cmd += ",script=%s" % script - cmd += ",downscript=%s" % (downscript or "no") + if ifname: cmd += ",ifname='%s'" % ifname + if script: cmd += ",script='%s'" % script + cmd += ",downscript='%s'" % (downscript or "no") return cmd def add_floppy(help, filename): - return " -fda %s" % filename + return " -fda '%s'" % filename def add_tftp(help, filename): - return " -tftp %s" % filename + return " -tftp '%s'" % filename def add_tcp_redir(help, host_port, guest_port): return " -redir tcp:%s::%s" % (host_port, guest_port) @@ -267,22 +267,22 @@ class VM: return " -nographic" def add_uuid(help, uuid): - return " -uuid %s" % uuid + return " -uuid '%s'" % uuid def add_pcidevice(help, host): - return " -pcidevice host=%s" % host + return " -pcidevice host='%s'" % host def add_initrd(help, filename): - return " -initrd %s" % filename + return " -initrd '%s'" % filename def add_kernel(help, filename): - return " -kernel %s" % filename + return " -kernel '%s'" % filename def add_kernel_cmdline(help, cmdline): - return " -append %s" % cmdline + return " -append '%s'" % cmdline def add_testdev(help, filename): - return (" -chardev file,id=testlog,path=%s" + return (" -chardev file,id=testlog,path='%s'" " -device testdev,chardev=testlog" % filename) # End of command line option wrappers