summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Dolbec <dolsen@gentoo.org>2016-03-22 17:27:35 -0700
committerBrian Dolbec <dolsen@gentoo.org>2016-03-22 17:27:35 -0700
commit329d2f3956245bc9451a492dad52fc98c880847b (patch)
tree6334d9b59dd141395d0749de6c40780e8343d585
parentTIMEOUT: remove duplicate default settings (diff)
downloadkvm-tools-329d2f3956245bc9451a492dad52fc98c880847b.tar.gz
kvm-tools-329d2f3956245bc9451a492dad52fc98c880847b.tar.bz2
kvm-tools-329d2f3956245bc9451a492dad52fc98c880847b.zip
Add version info and functions
-rw-r--r--app-emulation/qemu-init-scripts/files/qemu-conf.example2
-rwxr-xr-x[-rw-r--r--]app-emulation/qemu-init-scripts/files/qemu-init-script9
-rwxr-xr-x[-rw-r--r--]app-emulation/qemu-init-scripts/files/qtap-manipulate11
3 files changed, 21 insertions, 1 deletions
diff --git a/app-emulation/qemu-init-scripts/files/qemu-conf.example b/app-emulation/qemu-init-scripts/files/qemu-conf.example
index acdebcb..4911597 100644
--- a/app-emulation/qemu-init-scripts/files/qemu-conf.example
+++ b/app-emulation/qemu-init-scripts/files/qemu-conf.example
@@ -1,6 +1,8 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
+# VERSION: 0.3.0
+
# DO NOT MODIFY THIS FILE DIRECTLY! CREATE A COPY AND MODIFY THAT INSTEAD!
# VMTYPE is auto determined via the file prefix
diff --git a/app-emulation/qemu-init-scripts/files/qemu-init-script b/app-emulation/qemu-init-scripts/files/qemu-init-script
index f8773c9..937ddfe 100644..100755
--- a/app-emulation/qemu-init-scripts/files/qemu-init-script
+++ b/app-emulation/qemu-init-scripts/files/qemu-init-script
@@ -13,6 +13,8 @@
# where 'kvm' is the virtual machine type ('qemu' and 'kvm' allowed)
# and 'myserver' is the name of your instance.
+VERSION="0.3.0"
+
VMNAME=${SVCNAME#*.}
VMTYPE=${SVCNAME%.*}
VM_BINARY=
@@ -74,7 +76,7 @@ TIMEOUT=${TIMEOUT:-300}
SMP=${SMP:-1}
export KVM_USER=${KVM_USER:-"root"}
-extra_commands="reboot"
+extra_commands="reboot version"
depend() {
if [ "$VMNAME" = "$SVCNAME" ]; then
@@ -253,3 +255,8 @@ stop() {
eend $?
fi
}
+
+version() {
+ echo "qemu-init-scripts version: ${VERSION}"
+}
+
diff --git a/app-emulation/qemu-init-scripts/files/qtap-manipulate b/app-emulation/qemu-init-scripts/files/qtap-manipulate
index bf89dcb..53ab346 100644..100755
--- a/app-emulation/qemu-init-scripts/files/qtap-manipulate
+++ b/app-emulation/qemu-init-scripts/files/qtap-manipulate
@@ -2,6 +2,8 @@
# Copyright 1999-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public Licens
+VERSION="0.3.0"
+
has() {
local desired=$1 x
shift
@@ -47,6 +49,7 @@ usage() {
echo "create-specific qtap-name [ -u user ] [ -g group ]"
echo "create [ -u user ] [ -g group ]"
echo "destroy qtap-name"
+ echo "version"
echo
}
@@ -55,6 +58,10 @@ usage_die() {
die "$@"
}
+show_version() {
+ echo "qtap-manipulate version: ${VERSION}"
+}
+
create_user=
create_group=
@@ -110,8 +117,12 @@ case "$1" in
create_node "$qtap"
$output_qtap && echo "$qtap"
;;
+ version)
+ show_version
+ ;;
*)
usage_die "Unknown command $1"
;;
esac
exit 0
+