mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 00:33:55 -06:00
python: create qemu packages
move python/qemu/*.py to python/qemu/[machine, qmp, utils]/*.py and update import directives across the tree. This is done to create a PEP420 namespace package, in which we may create subpackages. To do this, the namespace directory ("qemu") should not have any modules in it. Those files will go into new 'machine', 'qmp' and 'utils' subpackages instead. Implement machine/__init__.py making the top-level classes and functions from its various modules available directly inside the package. Change qmp.py to qmp/__init__.py similarly, such that all of the useful QMP library classes are available directly from "qemu.qmp" instead of "qemu.qmp.qmp". Signed-off-by: John Snow <jsnow@redhat.com> Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com> Reviewed-by: Cleber Rosa <crosa@redhat.com> Message-id: 20210527211715.394144-10-jsnow@redhat.com Signed-off-by: John Snow <jsnow@redhat.com>
This commit is contained in:
parent
7f0a143b0c
commit
beb6b57b3b
17 changed files with 83 additions and 32 deletions
|
@ -41,11 +41,12 @@ else:
|
|||
|
||||
sys.path.append(os.path.join(SOURCE_DIR, 'python'))
|
||||
|
||||
from qemu.accel import kvm_available
|
||||
from qemu.accel import tcg_available
|
||||
from qemu.machine import QEMUMachine
|
||||
from qemu.utils import get_info_usernet_hostfwd_port
|
||||
|
||||
from qemu.utils import (
|
||||
get_info_usernet_hostfwd_port,
|
||||
kvm_available,
|
||||
tcg_available,
|
||||
)
|
||||
|
||||
def is_readable_executable_file(path):
|
||||
return os.path.isfile(path) and os.access(path, os.R_OK | os.X_OK)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue