WIP:aryan/build #2
Loading…
Reference in a new issue
No description provided.
Delete branch "aryan/build"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
go akemi go review this pleaseeeee
Looks great! Just a few minor changes
@ -3,1 +6,3 @@
print("meow")
def vm_start(nographic=False):
home = Path.home()
user = os.getlogin()
Documentation suggests using getuser
@ -4,0 +13,4 @@
initialize = [
"qemu-system-x86_64",
"-enable-kvm",
"-m", "2G", # ram allocation
Isn't this far too low? It should also be adjustable via argparse
@ -4,0 +14,4 @@
"qemu-system-x86_64",
"-enable-kvm",
"-m", "2G", # ram allocation
"-nic", "user,hostfwd=tcp::5555-:22", #forward port 5555 in host to port 22 in vm
This port should be configurable, otherwise we can't run several vms at the same time. Best put it in argparse
@ -4,0 +18,4 @@
"-drive", "file=%s,media=disk,if=virtio" % image_dest,
# "-nographic",
# "-serial", "mon:stdio",
What are these doing here?
@ -4,0 +21,4 @@
# "-serial", "mon:stdio",
"-vga", "virtio", # i think this fixes resolution but idk yet
"-display", "sdl",
Say I enable
nographic
. It seems like this display arg will conflict. Instead, it'd be better for these to be the else branch on the conditional below@ -4,0 +24,4 @@
"-display", "sdl",
]
if nographic==True:
==True
O.Oif nographic:
@ -4,0 +31,4 @@
#copy the base image to a directory with everyones virtual machines. -n should not overwrite any existing vms.
#subprocess.run(["cp", "-n", image_src, vm_storage_location])
Popen(initialize)
You'll want some sort of error handling here. What if the vm fails to start? Check the returncode and such on a
.communicate()
@ -4,0 +39,4 @@
parser.add_argument(
"--nographic",
action="store_true",
help="Run QEMU in nographic mode (runs the VM embedded in your terminal instead of opening a new window)",)
Did you use
black
to format this? Looks a bit oddView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.