Skip to content

Commit

Permalink
munet: add arm support
Browse files Browse the repository at this point in the history
  • Loading branch information
choppsv1 committed Apr 7, 2024
1 parent a3fda5a commit e647881
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions munet/native.py
Original file line number Diff line number Diff line change
Expand Up @@ -2161,11 +2161,21 @@ async def launch(self):
bootd = "d" if "iso" in qc else "c"
# args = [get_exec_path_host("qemu-system-x86_64"),
# "-nodefaults", "-boot", bootd]
args = [get_exec_path_host("qemu-system-x86_64"), "-boot", bootd]

args += ["-machine", "q35"]
rc, output, _ = commander.cmd_status("uname -m")
arm = False
if not rc and output.strip() == "aarch64":
qemu_path = get_exec_path_host("qemu-system-aarch64")
args = [qemu_path, "-boot", bootd, "-machine", "virt"]
arm = True
elif not rc and output.strip().startswith("arm"):
qemu_path = get_exec_path_host("qemu-system-arm")
args = [qemu_path, "-boot", bootd, "-machine", "virt"]
arm = True
else:
qemu_path = get_exec_path_host("qemu-system-x86_64")
args = [qemu_path, "-boot", bootd, "-machine", "q35"]

if qc.get("kvm"):
if qc.get("kvm") and not arm:
rc, _, e = await self.async_cmd_status_nsonly("ls -l /dev/kvm")
if rc:
self.logger.warning("Can't enable KVM no /dev/kvm: %s", e)
Expand Down

0 comments on commit e647881

Please sign in to comment.