提交 d422e625 编写于 作者: L Lucas Meneghel Rodrigues

Rename kvm_monitor to qemu_monitor

As part of our changes from kvm -> qemu.
Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
上级 703d5908
import re, logging, random, time
from autotest.client.shared import error
from virttest import kvm_monitor, utils_test
from virttest import qemu_monitor, utils_test
def run_balloon_check(test, params, env):
......@@ -25,7 +25,7 @@ def run_balloon_check(test, params, env):
fail = 0
try:
output = vm.monitor.info("balloon")
except kvm_monitor.MonitorError, e:
except qemu_monitor.MonitorError, e:
logging.error(e)
fail += 1
return 0, fail
......
import re, os, logging, time
from autotest.client.shared import utils, error
from virttest import kvm_monitor, storage, env_process, data_dir, utils_misc
from virttest import qemu_monitor, storage, env_process, data_dir, utils_misc
@error.context_aware
......@@ -36,7 +36,7 @@ def run_block_mirror(test, params, env):
try:
output = vm.monitor.info("block-jobs")
except kvm_monitor.MonitorError, e:
except qemu_monitor.MonitorError, e:
logging.error(e)
fail += 1
return None, None
......
import re, os, logging, time
from autotest.client.shared import utils, error
from virttest import kvm_monitor, env_process
from virttest import qemu_monitor, env_process
from virttest import data_dir
@error.context_aware
......@@ -34,7 +34,7 @@ def run_block_stream(test, params, env):
try:
output = vm.monitor.info("block-jobs")
except kvm_monitor.MonitorError, e:
except qemu_monitor.MonitorError, e:
logging.error(e)
fail += 1
return None, None
......
......@@ -8,7 +8,7 @@ KVM cdrom test
import logging, re, time, os
from autotest.client.shared import error
from autotest.client import utils
from virttest import utils_misc, aexpect, kvm_monitor, data_dir
from virttest import utils_misc, aexpect, qemu_monitor, data_dir
@error.context_aware
......@@ -98,16 +98,16 @@ def run_cdrom(test, params, env):
def eject_cdrom(device, monitor):
""" Ejects the cdrom using kvm-monitor """
if isinstance(monitor, kvm_monitor.HumanMonitor):
if isinstance(monitor, qemu_monitor.HumanMonitor):
monitor.cmd("eject %s" % device)
elif isinstance(monitor, kvm_monitor.QMPMonitor):
elif isinstance(monitor, qemu_monitor.QMPMonitor):
monitor.cmd("eject", args={'device': device})
def change_cdrom(device, target, monitor):
""" Changes the medium using kvm-monitor """
if isinstance(monitor, kvm_monitor.HumanMonitor):
if isinstance(monitor, qemu_monitor.HumanMonitor):
monitor.cmd("change %s %s" % (device, target))
elif isinstance(monitor, kvm_monitor.QMPMonitor):
elif isinstance(monitor, qemu_monitor.QMPMonitor):
monitor.cmd("change", args={'device': device, 'target': target})
cdrom_new = master_cdroms(params)
......
......@@ -10,7 +10,7 @@ from virttest.utils_cgroup import Cgroup
from virttest.utils_cgroup import CgroupModules
from virttest.utils_cgroup import get_load_per_cpu
from virttest.env_process import preprocess
from virttest import kvm_monitor
from virttest import qemu_monitor
from virttest.aexpect import ExpectTimeoutError
from virttest.aexpect import ExpectProcessTerminatedError
from virttest.aexpect import ShellTimeoutError
......@@ -1467,7 +1467,7 @@ def run_cgroup(test, params, env):
monitor_type = None
for i_monitor in range(len(vm.monitors)):
monitor = vm.monitors[i_monitor]
if isinstance(monitor, kvm_monitor.QMPMonitor):
if isinstance(monitor, qemu_monitor.QMPMonitor):
out = monitor.cmd_obj({"execute": "query-commands"})
try:
if {'name': '__com.redhat_drive_add'} in out['return']:
......
import re, string, logging
from autotest.client.shared import error
from virttest import kvm_monitor, storage, data_dir
from virttest import qemu_monitor, storage, data_dir
def run_physical_resources_check(test, params, env):
......@@ -24,7 +24,7 @@ def run_physical_resources_check(test, params, env):
o = ""
try:
o = vm.monitor.info(info_cmd)
except kvm_monitor.MonitorError, e:
except qemu_monitor.MonitorError, e:
fail_log = e + "\n"
fail_log += "info/query monitor command failed (%s)" % info_cmd
f_fail.append(fail_log)
......@@ -50,7 +50,7 @@ def run_physical_resources_check(test, params, env):
o = ""
try:
o = vm.monitor.info(info_cmd)
except kvm_monitor.MonitorError, e:
except qemu_monitor.MonitorError, e:
fail_log = e + "\n"
fail_log += "info/query monitor command failed (%s)" % info_cmd
f_fail.append(fail_log)
......@@ -209,7 +209,7 @@ def run_physical_resources_check(test, params, env):
o = ""
try:
o = vm.monitor.info("network")
except kvm_monitor.MonitorError, e:
except qemu_monitor.MonitorError, e:
fail_log = e + "\n"
fail_log += "info/query monitor command failed (network)"
n_fail.append(fail_log)
......
from autotest.client.shared import error
from virttest import kvm_monitor
from virttest import qemu_monitor
def run_qmp_basic(test, params, env):
......@@ -385,7 +385,7 @@ def run_qmp_basic(test, params, env):
# Look for the first qmp monitor available, otherwise, fail the test
qmp_monitor = None
for m in vm.monitors:
if isinstance(m, kvm_monitor.QMPMonitor):
if isinstance(m, qemu_monitor.QMPMonitor):
qmp_monitor = m
if qmp_monitor is None:
......
import logging
from autotest.client.shared import error
from virttest import kvm_monitor
from virttest import qemu_monitor
def run_qmp_basic_rhel6(test, params, env):
......@@ -371,7 +371,7 @@ def run_qmp_basic_rhel6(test, params, env):
# Look for the first qmp monitor available, otherwise, fail the test
qmp_monitor = None
for m in vm.monitors:
if isinstance(m, kvm_monitor.QMPMonitor):
if isinstance(m, qemu_monitor.QMPMonitor):
qmp_monitor = m
if qmp_monitor is None:
......
......@@ -10,7 +10,7 @@ Step file creator/editor.
import pygtk, gtk, gobject, time, os, commands, logging
from autotest.client.shared import error
from virttest import utils_misc, ppm_utils, step_editor
from virttest import kvm_monitor
from virttest import qemu_monitor
pygtk.require('2.0')
......@@ -139,7 +139,7 @@ class StepMaker(step_editor.StepMakerWindow):
try:
self.vm.monitor.screendump(self.screendump_filename, debug=False)
except kvm_monitor.MonitorError, e:
except qemu_monitor.MonitorError, e:
logging.warn(e)
else:
self.set_image_from_file(self.screendump_filename)
......@@ -293,7 +293,7 @@ class StepMaker(step_editor.StepMakerWindow):
try:
self.vm.monitor.screendump(self.screendump_filename, debug=False)
except kvm_monitor.MonitorError, e:
except qemu_monitor.MonitorError, e:
logging.warn(e)
else:
self.set_image_from_file(self.screendump_filename)
......
......@@ -6,7 +6,7 @@ Utilities to perform automatic guest installation using step files.
import os, time, shutil, logging
from autotest.client.shared import error
from virttest import utils_misc, ppm_utils, kvm_monitor
from virttest import utils_misc, ppm_utils, qemu_monitor
try:
import PIL.Image
......@@ -88,7 +88,7 @@ def barrier_2(vm, words, params, debug_dir, data_scrdump_filename,
# Request screendump
try:
vm.monitor.screendump(scrdump_filename, debug=False)
except kvm_monitor.MonitorError, e:
except qemu_monitor.MonitorError, e:
logging.warn(e)
continue
......
......@@ -4,7 +4,7 @@ import xml.dom.minidom
from autotest.client.shared import error, iso9660
from autotest.client import utils
from virttest import virt_vm, utils_misc, utils_disk
from virttest import kvm_monitor, remote, syslog_server
from virttest import qemu_monitor, remote, syslog_server
from virttest import http_server, data_dir, utils_net
......@@ -822,7 +822,7 @@ def run_unattended_install(test, params, env):
vm.verify_alive()
# Due to a race condition, sometimes we might get a MonitorError
# before the VM gracefully shuts down, so let's capture MonitorErrors.
except (virt_vm.VMDeadError, kvm_monitor.MonitorError), e:
except (virt_vm.VMDeadError, qemu_monitor.MonitorError), e:
if params.get("wait_no_ack", "no") == "yes":
break
else:
......@@ -886,6 +886,6 @@ def run_unattended_install(test, params, env):
try:
if utils_misc.wait_for(vm.is_dead, shutdown_cleanly_timeout, 1, 1):
logging.info("Guest managed to shutdown cleanly")
except kvm_monitor.MonitorError, e:
except qemu_monitor.MonitorError, e:
logging.warning("Guest apparently shut down, but got a "
"monitor error: %s", e)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册