From patchwork Mon Jan 3 18:27:13 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Goldish X-Patchwork-Id: 448681 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p03IRBb7024206 for ; Mon, 3 Jan 2011 18:27:20 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752477Ab1ACS1O (ORCPT ); Mon, 3 Jan 2011 13:27:14 -0500 Received: from mx1.redhat.com ([209.132.183.28]:53921 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752034Ab1ACS07 (ORCPT ); Mon, 3 Jan 2011 13:26:59 -0500 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p03IQwNS008103 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 3 Jan 2011 13:26:58 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p03IQviH017288; Mon, 3 Jan 2011 13:26:58 -0500 Received: from moof.tlv.redhat.com (dhcp-1-185.tlv.redhat.com [10.35.1.185]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p03IQeWe027298; Mon, 3 Jan 2011 13:26:56 -0500 From: Michael Goldish To: autotest@test.kernel.org, kvm@vger.kernel.org Cc: Michael Goldish Subject: [KVM-AUTOTEST PATCH 12/17] KVM test: kvm_preprocessing.py: simplify handling of params['migration_mode'] Date: Mon, 3 Jan 2011 20:27:13 +0200 Message-Id: <1294079238-21239-12-git-send-email-mgoldish@redhat.com> In-Reply-To: <1294079238-21239-1-git-send-email-mgoldish@redhat.com> References: <1294079238-21239-1-git-send-email-mgoldish@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25 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 (demeter1.kernel.org [140.211.167.41]); Mon, 03 Jan 2011 18:27:20 +0000 (UTC) diff --git a/client/tests/kvm/kvm_preprocessing.py b/client/tests/kvm/kvm_preprocessing.py index 450cf59..5ce0a3b 100644 --- a/client/tests/kvm/kvm_preprocessing.py +++ b/client/tests/kvm/kvm_preprocessing.py @@ -60,11 +60,12 @@ def preprocess_vm(test, params, env, name): start_vm = False - migration_mode = params.get("migration_mode", None) - if params.get("restart_vm") == "yes": logging.debug("'restart_vm' specified; (re)starting VM...") start_vm = True + elif params.get("migration_mode"): + logging.debug("Starting VM in incoming migration mode...") + start_vm = True elif params.get("start_vm") == "yes": if not vm.is_alive(): logging.debug("VM is not alive; starting it...") @@ -74,16 +75,11 @@ def preprocess_vm(test, params, env, name): logging.debug("VM's qemu command differs from requested one; " "restarting it...") start_vm = True - elif migration_mode is not None: - logging.debug("Starting VM on migration incoming mode...") - start_vm = True if start_vm: - if migration_mode is not None: - vm.create(name, params, test.bindir, migration_mode=migration_mode) - else: - # Start the VM (or restart it if it's already up) - vm.create(name, params, test.bindir) + # Start the VM (or restart it if it's already up) + vm.create(name, params, test.bindir, + migration_mode=params.get("migration_mode")) else: # Don't start the VM, just update its params vm.params = params