Skip to content

Commit

Permalink
Use disk optional configuration in qemu vm
Browse files Browse the repository at this point in the history
If the optional disk properties are specified, use them in the qemu
command. We will use this to debug the random kernel panics on github
actions.

This can be added later to vfkit and krunkit if needed.
  • Loading branch information
nirs committed Feb 23, 2025
1 parent d70b8c9 commit cd0cff5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion vmnet/vm.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def qemu_command(self):
raise ValueError("fd or socket required")
qemu = QEMU_CONFIG[platform.machine()]
firmware = qemu_firmware(qemu["arch"])
return [
cmd = [
self.driver_command or f"qemu-system-{qemu['arch']}",
"-name",
self.vm_name,
Expand Down Expand Up @@ -202,6 +202,16 @@ def qemu_command(self):
"-nodefaults",
]

# Optinal arguments

if "kernel" in self.disk:
cmd.extend(["-kernel", self.disk["kernel"]])
if "kernel_cmdline" in self.disk:
cmd.extend(["-append", self.disk["kernel_cmdline"]])
if "initrd" in self.disk:
cmd.extend(["-initrd", self.disk["initrd"]])

return cmd

def qemu_firmware(arch):
"""
Expand Down

0 comments on commit cd0cff5

Please sign in to comment.