]> gitweb.fluxo.info Git - kvmx.git/commitdiff
Warn the user to do manual config change if datadir is set ad rename/clone actions
authorSilvio Rhatto <rhatto@riseup.net>
Sun, 31 Dec 2017 02:56:24 +0000 (00:56 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Sun, 31 Dec 2017 02:56:24 +0000 (00:56 -0200)
TODO.md
kvmx

diff --git a/TODO.md b/TODO.md
index 4096bfc66ea5f3201ce9e5fc5de18c55bf6c88e9..f1e107d4f281c244a0bc2a04f6eb29bece3af598 100644 (file)
--- a/TODO.md
+++ b/TODO.md
@@ -1,7 +1,6 @@
 # TODO
 
 * A `kvmxctl`, `kvmx-host` or `kvmx-supervisor` to control VMs from all users in the system.
-* How to handle `$datadir` when VM is cloned or moved? Maybe just warn the user to do manual config change.
 * Fix isolinux support:
   * http://www.syslinux.org/wiki/index.php?title=Development/Testing
   * http://linux-kernel-driver.blogspot.com.br/2009/06/linux-kernel-development-using.html
diff --git a/kvmx b/kvmx
index 6ef49925ecb1a2064a0adcd66c34167854c7807c..b132f56779f9e36407ed69cb1758e6e56053a309 100755 (executable)
--- a/kvmx
+++ b/kvmx
@@ -1024,6 +1024,10 @@ function kvmx_clone {
     mv $FOLDER/ssh/$VM.key     $FOLDER/ssh/$DEST.key
     mv $FOLDER/ssh/$VM.key.pub $FOLDER/ssh/$DEST.key.pub
   fi
+
+  if [ "$DATADIR" != "$STORAGE" ]; then
+    echo "$BASENAME: please copy datadir $DATADIR manually"
+  fi
 }
 
 # Alias to clone
@@ -1474,6 +1478,10 @@ function kvmx_rename {
     mv $FOLDER/ssh/$VM.key     $FOLDER/ssh/$DEST.key
     mv $FOLDER/ssh/$VM.key.pub $FOLDER/ssh/$DEST.key.pub
   fi
+
+  if [ "$DATADIR" != "$STORAGE" ]; then
+    echo "$BASENAME: please move datadir $DATADIR manually"
+  fi
 }
 
 # Alias to rename