summaryrefslogtreecommitdiffstats
path: root/genome-autostarter/genome-autostarter.sh
diff options
context:
space:
mode:
authorBrenton Leanhardt <bleanhar@redhat.com>2008-07-17 13:48:40 -0400
committerBrenton Leanhardt <bleanhar@redhat.com>2008-07-17 17:57:53 -0400
commit142478c941841b34b20448e1e9bccd193aea1d45 (patch)
treefc519939e05ab2669bf1213e2f4dd876c86dff5a /genome-autostarter/genome-autostarter.sh
parent7eba082b3e877d2cfd9e9085c83d51961ec5d518 (diff)
downloadtools-142478c941841b34b20448e1e9bccd193aea1d45.tar.gz
tools-142478c941841b34b20448e1e9bccd193aea1d45.tar.xz
tools-142478c941841b34b20448e1e9bccd193aea1d45.zip
The autostarter now supports kvm
Diffstat (limited to 'genome-autostarter/genome-autostarter.sh')
-rw-r--r--genome-autostarter/genome-autostarter.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/genome-autostarter/genome-autostarter.sh b/genome-autostarter/genome-autostarter.sh
new file mode 100644
index 0000000..1555d05
--- /dev/null
+++ b/genome-autostarter/genome-autostarter.sh
@@ -0,0 +1,12 @@
+#!/bin/bash
+uname -a | grep -i xen
+if [ $? == 0 ]; then
+ # We're using Xen
+ find /etc/xen/auto -name "*" -type l | xargs -n1 basename 2> /dev/null | xargs -n1 virsh start &> /dev/null
+else
+ # We're using kvm
+ for vm_xml in `find /etc/libvirt/qemu/autostart -name "*" -type l`; do
+ vm=`basename $vm_xml .xml` # Chop of the extension
+ virsh start $vm &> /dev/null
+ done
+fi