|
14 | 14 | parser.add_argument("--memory", default="2G") |
15 | 15 | parser.add_argument("--debug", action="store_true", help="Enable QEMU debugging") |
16 | 16 | parser.add_argument("--display", action="store_true", help="Add a display device to the VM") |
| 17 | +parser.add_argument("--disk", action="store_true", help="Add a disk device to the VM") |
17 | 18 |
|
18 | 19 |
|
19 | 20 |
|
|
44 | 45 | "-snapshot": None, |
45 | 46 | "-kernel": bin_executable_location, |
46 | 47 | "-append": f"{append_args} --rootfs=ext4fs --automount=/dev,devfs --automount=/tmp,tmpfs --automount=/proc,procfs --automount=/sys,sysfs", |
47 | | - "-drive": "file=ubuntu-noble-arm64.img,format=raw,if=none,cache=none,id=x0", |
48 | 48 | } |
49 | 49 |
|
50 | 50 | # Arguments that can appear multiple times (e.g. -device) |
51 | | -extra_args = ["-device", "virtio-rng-device", "-device", "virtio-blk-device,drive=x0"] |
| 51 | +extra_args = ["-device", "virtio-rng-device"] |
52 | 52 |
|
53 | 53 | if args.debug: |
54 | 54 | default_args["-S"] = None |
|
61 | 61 | default_args["-serial"] = "stdio" |
62 | 62 | extra_args += ["-device", "virtio-gpu-device"] |
63 | 63 |
|
| 64 | +if args.disk: |
| 65 | + default_args["-drive"] = "file=ubuntu-noble-arm64.img,format=raw,if=none,cache=none,id=x0" |
| 66 | + extra_args += ["-device", "virtio-blk-device,drive=x0"] |
| 67 | + |
64 | 68 | qemu_command = ["qemu-system-aarch64"] |
65 | 69 |
|
66 | 70 | for key, value in default_args.items(): |
|
0 commit comments