public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Lucas Meneghel Rodrigues <lmr@redhat.com>
To: autotest@test.kernel.org
Cc: kvm@vger.kernel.org, Lucas Meneghel Rodrigues <lmr@redhat.com>,
	Michael Goldish <mgoldish@redhat.com>
Subject: [KVM-AUTOTEST PATCH 7/8] Add new function, VM.clone() to clone an existing VM
Date: Fri,  5 Jun 2009 17:46:33 -0300	[thread overview]
Message-ID: <1244234794-7844-8-git-send-email-lmr@redhat.com> (raw)
In-Reply-To: <1244234794-7844-7-git-send-email-lmr@redhat.com>

This method will be useful when writing functional tests.

Risk: Low (new method of the kvm test API)
Visibility: Low (kvm test developers will have an additional
API to use)

Signed-off-by: Michael Goldish <mgoldish@redhat.com>
---
 client/tests/kvm/kvm_vm.py |   19 +++++++++++++++++++
 1 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/client/tests/kvm/kvm_vm.py b/client/tests/kvm/kvm_vm.py
index 3001648..b81c0df 100644
--- a/client/tests/kvm/kvm_vm.py
+++ b/client/tests/kvm/kvm_vm.py
@@ -126,6 +126,25 @@ class VM:
                 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)
+
+
     def verify_process_identity(self):
         """
         Make sure .pid really points to the original qemu process. If .pid
-- 
1.6.2.2


  reply	other threads:[~2009-06-05 20:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-05 20:46 [KVM-AUTOTEST PATCH 0/8] Re-submitting some of the patches on the patch queue Lucas Meneghel Rodrigues
2009-06-05 20:46 ` [KVM-AUTOTEST PATCH 1/8] kvm_config: Allow for "=" in the value of a config parameter Lucas Meneghel Rodrigues
2009-06-05 20:46   ` [KVM-AUTOTEST PATCH 2/8] RHEL-4.7 step files: fix the initial boot barriers Lucas Meneghel Rodrigues
2009-06-05 20:46     ` [KVM-AUTOTEST PATCH 3/8] WinXP step file fixes Lucas Meneghel Rodrigues
2009-06-05 20:46       ` [KVM-AUTOTEST PATCH 4/8] RHEL 5.3 " Lucas Meneghel Rodrigues
2009-06-05 20:46         ` [KVM-AUTOTEST PATCH 5/8] stepeditor.py: get rid of some shortcuts Lucas Meneghel Rodrigues
2009-06-05 20:46           ` [KVM-AUTOTEST PATCH 6/8] Choose a monitor filename in the constructor of VM class Lucas Meneghel Rodrigues
2009-06-05 20:46             ` Lucas Meneghel Rodrigues [this message]
2009-06-05 20:46               ` [KVM-AUTOTEST PATCH 8/8] kvm_runtest_2.py: use pickle instead of shelve when loading/saving env Lucas Meneghel Rodrigues
2009-06-08 15:21                 ` Lucas Meneghel Rodrigues
2009-06-08 16:10                 ` [Autotest] " Martin Bligh
2009-06-08 16:54                   ` Lucas Meneghel Rodrigues
2009-06-08 15:20               ` [KVM-AUTOTEST PATCH 7/8] Add new function, VM.clone() to clone an existing VM Lucas Meneghel Rodrigues

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1244234794-7844-8-git-send-email-lmr@redhat.com \
    --to=lmr@redhat.com \
    --cc=autotest@test.kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=mgoldish@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox