summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-07-21 16:14:00 +0300
committerThanos Apollo <[email protected]>2023-07-21 16:14:00 +0300
commit286f30a189dadfc3e0de7342eae7f008e6b549c6 (patch)
tree53da49f092ed2f59811340667453a612b09e5bca
parent5f68a8125d664736bfa3cc0c38d7f943eba7d311 (diff)
emacs: Update vm manager
-rwxr-xr-xemacs.org13
1 files changed, 10 insertions, 3 deletions
diff --git a/emacs.org b/emacs.org
index 9f24b86..9b0fc23 100755
--- a/emacs.org
+++ b/emacs.org
@@ -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