From: Michael Goldish Subject: [KVM-AUTOTEST PATCH 01/18] KVM test: kvm_preprocessing.py: allow modifying VM params without restarting Date: Fri, 18 Jun 2010 03:14:18 +0300 Message-ID: <1276820075-31310-1-git-send-email-mgoldish@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: autotest@test.kernel.org, kvm@vger.kernel.org Return-path: 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 Currently a VM's params are changed before the test only if it's restarted. This patch allows VM params to be changed when it isn't restarted. This is useful for params that can have an effect without a restart, such as main_monitor: monitors can be switched between tests without restarting, so that one test talks to the human monitor and the next test talks to the QMP monitor of the same VM. Signed-off-by: Michael Goldish --- client/tests/kvm/kvm_preprocessing.py | 9 +++++++-- 1 files changed, 7 insertions(+), 2 deletions(-) diff --git a/client/tests/kvm/kvm_preprocessing.py b/client/tests/kvm/kvm_preprocessing.py index ee3e9b2..17f3a29 100644 --- a/client/tests/kvm/kvm_preprocessing.py +++ b/client/tests/kvm/kvm_preprocessing.py @@ -79,8 +79,13 @@ def preprocess_vm(test, params, env, name): "restarting it...") start_vm = True - if start_vm and not vm.create(name, params, test.bindir, for_migration): - raise error.TestError("Could not start VM") + if start_vm: + # Start the VM (or restart it if it's already up) + if not vm.create(name, params, test.bindir, for_migration): + raise error.TestError("Could not start VM") + else: + # Don't start the VM, just update its params + vm.params = params scrdump_filename = os.path.join(test.debugdir, "pre_%s.ppm" % name) try: -- 1.5.4.1