]> gitweb.fluxo.info Git - kvmx.git/commitdiff
Fix: provide default parameters by loading the sample config
authorSilvio Rhatto <rhatto@riseup.net>
Wed, 19 Jun 2024 18:40:11 +0000 (15:40 -0300)
committerSilvio Rhatto <rhatto@riseup.net>
Wed, 19 Jun 2024 18:40:11 +0000 (15:40 -0300)
ChangeLog.md
kvmx
kvmxfile

index e7e4283bcf1e42867e8ab91b9db43eb870aede6d..d2062bd5911c069d1037ed647697fc75e4dfa3cd 100644 (file)
@@ -1,5 +1,10 @@
 # ChangeLog
 
+## 0.1.1 - unreleased
+
+* Provide default parameters by loading the sample config.
+  This allows a `kvmxfile` to be small and have only the overrides.
+
 ## 0.1.0 - 2024-05-17
 
 * This software started on 2017-03-09, but only now it's getting an initial
diff --git a/kvmx b/kvmx
index 2afc9b3c9c2ccc076140e8e279fcda2b0e7a5ee2..214f5609a44878e374f31a6b00822e3c4320dd38 100755 (executable)
--- a/kvmx
+++ b/kvmx
@@ -19,7 +19,7 @@
 #
 
 # Basic parameters
-VERSION="0.1.0"
+VERSION="0.1.1"
 BASENAME="`basename $0`"
 DIRNAME="`dirname $0`"
 ACTION="$1"
@@ -122,17 +122,20 @@ function __kvmx_initialize {
   GUEST_DISPLAY="$(((RANDOM % 10) + 1))"
   XDMCP_PORT="$(($RANDOM + 10000))"
 
+  # Load the default config, providing defaults
+  source $APP_BASE/kvmxfile || exit 1
+
+  # Set hostname (this is already done with the default config)
+  #hostname="${hostname:-$VM}"
+
+  # Set domain (this is already done with the default config)
+  #domain="${domain:-example.org}"
+
   # Load user config
   if [ -e "$GLOBAL_USER_CONFIG_FILE" ]; then
     source $GLOBAL_USER_CONFIG_FILE
   fi
 
-  # Set hostname
-  hostname="${hostname:-$VM}"
-
-  # Set domain
-  domain="${domain:-example.org}"
-
   # Load and check guest config
   if [ "$ACTION" != "ls" ] && [ "$ACTION" != "edit" ] && [ "$ACTION" != "usage" ]; then
     if [ ! -e "$GLOBAL_USER_CONFIG_FOLDER/$VM" ]; then
index 191b1608ab79ad2805fd5a94b4f3bddc8535e0ac..ab698cfb4eb1ff05647cf35c83d1f11574e2d19e 100644 (file)
--- a/kvmxfile
+++ b/kvmxfile
@@ -30,8 +30,8 @@ net="user"
 
 # Set this is you want to be able to share a single folder between host and guest.
 # Needs ssh_support set to "y" and a workable SSH connection to the guest.
-shared_folder="."
-shared_folder_mountpoint="/home/$user/code/$VM"
+#shared_folder="."
+#shared_folder_mountpoint="/home/$user/code/$VM"
 #shared_folder="$HOME/temp/shared/$VM"
 #shared_folder_mountpoint="/home/$user/temp/shared/$VM"
 #shared_folder_mountpoint="/srv/shared"
@@ -105,10 +105,10 @@ graphics="-vga qxl"
 vnc_client="virt-viewer"
 
 # SPICE support
-spice="1"
+spice="0"
 
 # Set this if you want to attach an spice client when the machine boots.
-run_spice_client="1"
+run_spice_client="0"
 
 # SPICE client
 #spice_client="remote-viewer"
@@ -116,7 +116,7 @@ run_spice_client="1"
 spice_client="spicy"
 
 # Set this if you want that kvmx-vdagent is triggered after the machine boots.
-kvmx_vdagent="1"
+kvmx_vdagent="0"
 
 # Set this if you want to start an xpra session when the machine boots.
 run_xpra="0"