From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [KVM-AUTOTEST PATCH] kvm_vm.py: add new function VM.clone() which returns a clone of the VM Date: Mon, 25 May 2009 15:01:51 +0300 Message-ID: <4A1A88AF.7050406@redhat.com> References: <8e37a36c044c20259dcd8a34d72a651e85b37d5f.1243179847.git.mgoldish@redhat.com> <838bcae1b49be011e2cde1294a391a296059464a.1243179847.git.mgoldish@redhat.com> <6a70cb56a775fdb688da0231073abb0ce4baa7b1.1243179847.git.mgoldish@redhat.com> <63bacaa214ccd95c18fb644056855acd72757ac4.1243179847.git.mgoldish@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Michael Goldish Return-path: Received: from mx2.redhat.com ([66.187.237.31]:46660 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751820AbZEYMBw (ORCPT ); Mon, 25 May 2009 08:01:52 -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 n4PC1sFr016166 for ; Mon, 25 May 2009 08:01:54 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: Michael Goldish wrote: > Signed-off-by: Michael Goldish > --- > client/tests/kvm_runtest_2/kvm_vm.py | 18 ++++++++++++++++++ > 1 files changed, 18 insertions(+), 0 deletions(-) > > diff --git a/client/tests/kvm_runtest_2/kvm_vm.py b/client/tests/kvm_runtest_2/kvm_vm.py > index af06693..9571a3b 100644 > --- a/client/tests/kvm_runtest_2/kvm_vm.py > +++ b/client/tests/kvm_runtest_2/kvm_vm.py > @@ -115,6 +115,24 @@ class VM: > if not os.path.exists(self.monitor_file_name): > break > > + def clone(self, name=None, params=None, qemu_path=None, image_dir=None, iso_dir=None): > + """Return a clone of the VM object with optionally modified parameters. > + > + The clone is initially not alive and needs to be started using create(). > + Any parameters not passed to this function are copied from the source VM. > + """ > + if name == None: > + name = self.name > + if params == None: > + params = self.params.copy() > + if qemu_path == None: > + qemu_path = self.qemu_path > + if image_dir == None: > + image_dir = self.image_dir > + if iso_dir == None: > + iso_dir = self.iso_dir > + return VM(name, params, qemu_path, image_dir, iso_dir) > + > return VM(name or self.name, params or self.params.copy(), ...) -- error compiling committee.c: too many arguments to function