1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-24 17:28:08 +00:00

Do not list qemu binary with -spice in the name

It's create confusion and you can enable spice with the -spice
options.

Fix https://github.com/GNS3/gns3-gui/issues/981
This commit is contained in:
Julien Duponchelle 2016-02-03 16:38:46 +01:00
parent 71c3bda0a5
commit 537122daba
No known key found for this signature in database
GPG Key ID: F1E2485547D4595D
2 changed files with 4 additions and 1 deletions

View File

@ -117,6 +117,8 @@ class Qemu(BaseManager):
for path in Qemu.paths_list(): for path in Qemu.paths_list():
try: try:
for f in os.listdir(path): for f in os.listdir(path):
if f.endswith("-spice"):
continue
if (f.startswith("qemu-system") or f.startswith("qemu-kvm") or f == "qemu" or f == "qemu.exe") and \ if (f.startswith("qemu-system") or f.startswith("qemu-kvm") or f == "qemu" or f == "qemu.exe") and \
os.access(os.path.join(path, f), os.X_OK) and \ os.access(os.path.join(path, f), os.X_OK) and \
os.path.isfile(os.path.join(path, f)): os.path.isfile(os.path.join(path, f)):

View File

@ -50,7 +50,7 @@ def test_get_qemu_version(loop):
def test_binary_list(loop): def test_binary_list(loop):
files_to_create = ["qemu-system-x86", "qemu-system-x42", "qemu-kvm", "hello"] files_to_create = ["qemu-system-x86", "qemu-system-x42", "qemu-kvm", "hello", "qemu-system-x86_64-spice"]
for file_to_create in files_to_create: for file_to_create in files_to_create:
path = os.path.join(os.environ["PATH"], file_to_create) path = os.path.join(os.environ["PATH"], file_to_create)
@ -70,6 +70,7 @@ def test_binary_list(loop):
assert {"path": os.path.join(os.environ["PATH"], "qemu-kvm"), "version": version} in qemus assert {"path": os.path.join(os.environ["PATH"], "qemu-kvm"), "version": version} in qemus
assert {"path": os.path.join(os.environ["PATH"], "qemu-system-x42"), "version": version} in qemus assert {"path": os.path.join(os.environ["PATH"], "qemu-system-x42"), "version": version} in qemus
assert {"path": os.path.join(os.environ["PATH"], "hello"), "version": version} not in qemus assert {"path": os.path.join(os.environ["PATH"], "hello"), "version": version} not in qemus
assert {"path": os.path.join(os.environ["PATH"], "qemu-system-x86_64-spice"), "version": version} not in qemus
qemus = loop.run_until_complete(asyncio.async(Qemu.binary_list(["x86"]))) qemus = loop.run_until_complete(asyncio.async(Qemu.binary_list(["x86"])))