Skip to content

Commit

Permalink
Support for custom Qemu path in templates and nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
grossmj committed Apr 3, 2024
1 parent e1d3ee1 commit 123b5d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion gns3server/compute/qemu/qemu_vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ def __init__(
except QemuError:
# If the binary is not found for topologies 1.4 and later
# search via the platform otherwise use the binary name
log.warning(f"Could not find the QEMU binary {qemu_path} on this system, "
f"trying to find one using platform {platform}")
if platform:
self.platform = platform
else:
Expand Down Expand Up @@ -242,7 +244,7 @@ def qemu_path(self, qemu_path):
if qemu_path and os.pathsep not in qemu_path:
new_qemu_path = shutil.which(qemu_path, path=os.pathsep.join(self._manager.paths_list()))
if new_qemu_path is None:
raise QemuError(f"QEMU binary path {qemu_path} is not found in the path")
raise QemuError(f"QEMU binary '{qemu_path}' cannot be found on the system")
qemu_path = new_qemu_path

self._check_qemu_path(qemu_path)
Expand Down Expand Up @@ -289,6 +291,7 @@ def platform(self):
def platform(self, platform):

self._platform = platform
log.info(f"QEMU VM '{self._name}' [{self._id}] has set the platform {platform}")
self.qemu_path = f"qemu-system-{platform}"

def _disk_setter(self, variable, value):
Expand Down
1 change: 1 addition & 0 deletions gns3server/db_migrations/README
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Generic single-database configuration with an async dbapi.

# Command to generate a revision
alembic upgrade head
alembic revision --autogenerate -m "add fields in table"

0 comments on commit 123b5d0

Please sign in to comment.