From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 7EC2EC392 for ; Mon, 6 Jul 2015 07:40:21 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP; 05 Jul 2015 22:40:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,413,1432623600"; d="scan'208";a="519395569" Received: from shvmail01.sh.intel.com ([10.239.29.42]) by FMSMGA003.fm.intel.com with ESMTP; 05 Jul 2015 22:40:19 -0700 Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com [10.239.29.90]) by shvmail01.sh.intel.com with ESMTP id t665eHMG020082; Mon, 6 Jul 2015 13:40:17 +0800 Received: from shecgisg003.sh.intel.com (localhost [127.0.0.1]) by shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id t665eFFc002061; Mon, 6 Jul 2015 13:40:17 +0800 Received: (from yliu84x@localhost) by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id t665eFwD002057; Mon, 6 Jul 2015 13:40:15 +0800 From: Yong Liu To: dts@dpdk.org Date: Mon, 6 Jul 2015 13:40:13 +0800 Message-Id: <1436161213-2025-1-git-send-email-yong.liu@intel.com> X-Mailer: git-send-email 1.7.4.1 Subject: [dts] [PATCH] Add qemu option support in virtualization framework X-BeenThere: dts@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: test suite reviews and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jul 2015 05:40:22 -0000 From: Marvin Liu This option support manually configure qemu emulator path. Signed-off-by: Marvin Liu diff --git a/framework/qemu_kvm.py b/framework/qemu_kvm.py index 20a1df4..b305814 100644 --- a/framework/qemu_kvm.py +++ b/framework/qemu_kvm.py @@ -151,19 +151,27 @@ class QEMUKvm(VirtBase): """ Set the qemu emulator in the specified path explicitly. """ - qemu_emulator_path = str(qemu_emulator_path) out = self.host_session.send_expect( - 'ls %s' % qemu_emulator_path, '[.*') + 'ls %s' % qemu_emulator_path, '# ') if 'No such file or directory' in out: self.host_logger.error("No emulator [ %s ] on the DUT [ %s ]" % - (qemu_emulator, self.host_dut.get_ip_address())) + (qemu_emulator_path, self.host_dut.get_ip_address())) return None out = self.host_session.send_expect("[ -x %s ];echo $?" % qemu_emulator_path, '# ') - if out == '1': + if out != '0': self.host_logger.error("Emulator [ %s ] not executable on the DUT [ %s ]" % - (qemu_emulator, self.host_dut.get_ip_address())) + (qemu_emulator_path, self.host_dut.get_ip_address())) return None - self.qemu_emulator = qemu_emulator + self.qemu_emulator = qemu_emulator_path + + def add_vm_qemu(self, **options): + """ + path: absolute path for qemu emulator + """ + import pdb + pdb.set_trace() + if 'path' in options.keys(): + self.set_qemu_emulator(options['path']) def has_virtual_ability(self): """ -- 1.9.3