From 286f30a189dadfc3e0de7342eae7f008e6b549c6 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Fri, 21 Jul 2023 16:14:00 +0300 Subject: emacs: Update vm manager --- emacs.org | 13 ++++++++++--- 1 file 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 -- cgit v1.2.3