python/qemu: split QEMUMachine out from underneath __init__.py

It's not obvious that something named __init__.py actually houses
important code that isn't relevant to python packaging glue. Move the
QEMUMachine and related error classes out into their own module.

Adjust users to the new import location.

Signed-off-by: John Snow <jsnow@redhat.com>
Message-Id: <20190627212816.27298-2-jsnow@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
This commit is contained in:
John Snow
2019-07-01 19:02:10 -03:00
committed by Eduardo Habkost
parent 08aa87f5e7
commit abf0bf998d
10 changed files with 540 additions and 519 deletions
+1 -501
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -14,7 +14,7 @@
import socket
import os
from . import QEMUMachine
from .machine import QEMUMachine
class QEMUQtestProtocol(object):
+1 -1
View File
@@ -36,7 +36,7 @@ import argparse
from itertools import chain
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'python'))
from qemu import QEMUMachine
from qemu.machine import QEMUMachine
logger = logging.getLogger('device-crash-test')
dbg = logger.debug
+1 -1
View File
@@ -25,7 +25,7 @@ import json
from graphviz import Digraph
sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'python'))
from qemu import MonitorResponseError
from qemu.machine import MonitorResponseError
def perm(arr):
+1 -1
View File
@@ -17,7 +17,7 @@ import avocado
SRC_ROOT_DIR = os.path.join(os.path.dirname(__file__), '..', '..', '..')
sys.path.append(os.path.join(SRC_ROOT_DIR, 'python'))
from qemu import QEMUMachine
from qemu.machine import QEMUMachine
def is_readable_executable_file(path):
return os.path.isfile(path) and os.access(path, os.R_OK | os.X_OK)
+1 -1
View File
@@ -12,7 +12,7 @@ import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'python'))
from qemu import QEMUMachine
from qemu.machine import QEMUMachine
from avocado_qemu import Test
# Virtio Device IDs:
+11 -11
View File
@@ -30,7 +30,7 @@ from guestperf.timings import TimingRecord, Timings
sys.path.append(os.path.join(os.path.dirname(__file__),
'..', '..', '..', 'python'))
import qemu
from qemu.machine import QEMUMachine
class Engine(object):
@@ -386,17 +386,17 @@ class Engine(object):
dstmonaddr = "/var/tmp/qemu-dst-%d-monitor.sock" % os.getpid()
srcmonaddr = "/var/tmp/qemu-src-%d-monitor.sock" % os.getpid()
src = qemu.QEMUMachine(self._binary,
args=self._get_src_args(hardware),
wrapper=self._get_src_wrapper(hardware),
name="qemu-src-%d" % os.getpid(),
monitor_address=srcmonaddr)
src = QEMUMachine(self._binary,
args=self._get_src_args(hardware),
wrapper=self._get_src_wrapper(hardware),
name="qemu-src-%d" % os.getpid(),
monitor_address=srcmonaddr)
dst = qemu.QEMUMachine(self._binary,
args=self._get_dst_args(hardware, uri),
wrapper=self._get_dst_wrapper(hardware),
name="qemu-dst-%d" % os.getpid(),
monitor_address=dstmonaddr)
dst = QEMUMachine(self._binary,
args=self._get_dst_args(hardware, uri),
wrapper=self._get_dst_wrapper(hardware),
name="qemu-dst-%d" % os.getpid(),
monitor_address=dstmonaddr)
try:
src.launch()
+1 -1
View File
@@ -25,7 +25,7 @@ from iotests import qemu_img_create, qemu_io, file_path, log
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'python'))
from qemu import QEMUMachine
from qemu.machine import QEMUMachine
# Note:
# This test was added to check that mirror dead-lock was fixed (see previous
+2 -1
View File
@@ -18,7 +18,8 @@ import logging
import time
import datetime
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'python'))
from qemu import QEMUMachine, kvm_available
from qemu import kvm_available
from qemu.machine import QEMUMachine
import subprocess
import hashlib
import optparse