You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
parser=ArgumentParser(description="A set of common parameters for the tooling", add_help=True)
50
+
51
+
# Defaults to the order of which the harddrives are defined.
52
+
boot_option=parser.add_mutually_exclusive_group()
53
+
boot_option.add_argument('--uki', help='Boot a UKI (EFI) image')
54
+
boot_option.add_argument('--kernel', help='Boot a Linux kernel')
55
+
boot_option.add_argument('--iso', help='Boot a ISO 9660')
56
+
57
+
networking=parser.add_argument_group("Networking", "Disables the default '-net nic -net user' network behavior of Qemu.")
58
+
networking.add_argument("--tap", nargs="?", help="Configures a TAP interface and passes it in as a virtio-net-pci.", default=None, type=str)
59
+
networking.add_argument("--tap-mac", nargs="?", help="MAC for the --tap interface", default='52:54:00:00:00:02')
60
+
networking.add_argument("--bridge", nargs="?", help="Configures a bridge, to which the --tap is added.", default=None, type=str)
61
+
networking.add_argument("--bridge-mac", nargs="?", help="MAC for the interface", default=None)
62
+
networking.add_argument("--bridge-master", nargs="?", help="Which interface to set as 'master' on the bridge.", default=None, type=str)
63
+
64
+
hardware=parser.add_argument_group("Hardware", "General hardware specs for the virtual machine")
65
+
# To override the use of EFI boot (will not work with --uki for obvious reasons)
66
+
hardware.add_argument("--bios", action="store_true", help="Disables EFI (edk2/ovmf) and uses BIOS support instead", default=False)
67
+
hardware.add_argument("--memory", nargs="?", help="Ammount of memory to supply the machine", default=8192)
68
+
hardware.add_argument("--harddrive", action='append', help="Sets up one or more virtio-scsi-pci, size is defined by --harddrive test.qcow2:15G", type=str)
69
+
hardware.add_argument("--cpu", help="Sets the number of cores to allocate (default nproc -1)", type=str, default=os.cpu_count() -1ifos.cpu_count() else1)
# We'll allow it, because maybe we're tesing what happens without networking, but the NIC exists. Or the user has some creative iptables/nftables forwarding.
93
+
print(orange("--tap does not have a master, consider adding --bridge or manual set a master using ip-link(8)."))
94
+
95
+
ifargs.tapisNoneandargs.bridge:
96
+
print(orange("--bridge* arguments will be ignored since there's no --tap defined"))
parser=ArgumentParser(description="A set of common parameters for the tooling", add_help=True)
268
-
269
-
# Defaults to the order of which the harddrives are defined.
270
-
boot_option=parser.add_mutually_exclusive_group()
271
-
boot_option.add_argument('--uki', help='Boot a UKI (EFI) image')
272
-
boot_option.add_argument('--kernel', help='Boot a Linux kernel')
273
-
boot_option.add_argument('--iso', help='Boot a ISO 9660')
274
-
275
-
networking=parser.add_argument_group("Networking", "Disables the default '-net nic -net user' network behavior of Qemu.")
276
-
networking.add_argument("--tap", nargs="?", help="Configures a TAP interface and passes it in as a virtio-net-pci.", default=None, type=str)
277
-
networking.add_argument("--tap-mac", nargs="?", help="MAC for the --tap interface", default='52:54:00:00:00:02')
278
-
networking.add_argument("--bridge", nargs="?", help="Configures a bridge, to which the --tap is added.", default=None, type=str)
279
-
networking.add_argument("--bridge-mac", nargs="?", help="MAC for the interface", default=None)
280
-
networking.add_argument("--bridge-master", nargs="?", help="Which interface to set as 'master' on the bridge.", default=None, type=str)
281
-
282
-
hardware=parser.add_argument_group("Hardware", "General hardware specs for the virtual machine")
283
-
# To override the use of EFI boot (will not work with --uki for obvious reasons)
284
-
hardware.add_argument("--bios", action="store_true", help="Disables EFI (edk2/ovmf) and uses BIOS support instead", default=False)
285
-
hardware.add_argument("--memory", nargs="?", help="Ammount of memory to supply the machine", default=8192)
286
-
hardware.add_argument("--harddrive", action='append', help="Sets up one or more virtio-scsi-pci, size is defined by --harddrive test.qcow2:15G", type=str)
287
-
hardware.add_argument("--cpu", help="Sets the number of cores to allocate (default nproc -1)", type=str, default=os.cpu_count() -1ifos.cpu_count() else1)
# We'll allow it, because maybe we're tesing what happens without networking, but the NIC exists. Or the user has some creative iptables/nftables forwarding.
311
-
print(orange(f"--tap does not have a master, consider adding --bridge or manual set a master using ip-link(8)."))
312
-
313
-
ifargs.tapisNoneandargs.bridge:
314
-
print(orange(f"--bridge* arguments will be ignored since there's no --tap defined"))
0 commit comments