diff options
author | Thanos Apollo <[email protected]> | 2023-07-21 16:14:00 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-07-21 16:14:00 +0300 |
commit | 286f30a189dadfc3e0de7342eae7f008e6b549c6 (patch) | |
tree | 53da49f092ed2f59811340667453a612b09e5bca /emacs.org | |
parent | 5f68a8125d664736bfa3cc0c38d7f943eba7d311 (diff) |
emacs: Update vm manager
Diffstat (limited to 'emacs.org')
-rwxr-xr-x | emacs.org | 13 |
1 files changed, 10 insertions, 3 deletions
@@ -330,17 +330,24 @@ Fonts and basic appearance settings for each device #+end_src * VM Manager #+begin_src emacs-lisp + (defvar vm-directory "~/VirtualMachines/") + (defun vm-create-image () - (let ((name (format "%s.qcow2" (read-string "Name: "))) + "Create qcow2 image." + (interactive) + (let ((name (format "%s%s.qcow2" vm-directory (read-string "Name: "))) (size (format "%s" (read-string "Size(G): ")))) (shell-command (format "qemu-img create -f qcow2 %s %sG" name size)))) + (defun vm-run () + "Spawn Virtual Machine." + (interactive) (let ((memory (format "%sG" (read-string "Memory(G): "))) (cores (read-string "Cores: ")) - (image (read-file-name "Image: ")) - (iso (if (y-or-n-p "Load iso? ") + (image (read-file-name "Image: " vm-directory)) + (iso (if (y-or-n-p "Load iso?? ") (read-file-name "ISO: ") nil))) (async-shell-command |