summaryrefslogtreecommitdiffstats
path: root/os-plugins
diff options
context:
space:
mode:
authorDirk von Suchodoletz2009-02-19 02:08:23 +0100
committerDirk von Suchodoletz2009-02-19 02:08:23 +0100
commit9d974202af1ecd5c61df0982cbe4a206d26d5bed (patch)
tree8b03d29e3e8cb3ed8206ab0a57797c945fe8bc5b /os-plugins
parentNext set of fixes and cleanups ... (diff)
downloadcore-9d974202af1ecd5c61df0982cbe4a206d26d5bed.tar.gz
core-9d974202af1ecd5c61df0982cbe4a206d26d5bed.tar.xz
core-9d974202af1ecd5c61df0982cbe4a206d26d5bed.zip
Cleanup and fixes for the qemukvm plugin (but still not operable).
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2614 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'os-plugins')
-rw-r--r--os-plugins/plugins/qemukvm/OpenSLX/Distro/Suse.pm3
-rw-r--r--os-plugins/plugins/qemukvm/XX_qemukvm.sh18
-rw-r--r--os-plugins/plugins/qemukvm/files/run-virt.include24
3 files changed, 28 insertions, 17 deletions
diff --git a/os-plugins/plugins/qemukvm/OpenSLX/Distro/Suse.pm b/os-plugins/plugins/qemukvm/OpenSLX/Distro/Suse.pm
index b7d996f6..719dae2b 100644
--- a/os-plugins/plugins/qemukvm/OpenSLX/Distro/Suse.pm
+++ b/os-plugins/plugins/qemukvm/OpenSLX/Distro/Suse.pm
@@ -34,9 +34,6 @@ sub fillRunlevelScript
my $script = unshiftHereDoc(<<' End-of-Here');
- # cpuvirt=$(grep -e "vmx|svm" /proc/cpuinfo)
- # modprobe $cpuvirt
-
End-of-Here
return $script;
diff --git a/os-plugins/plugins/qemukvm/XX_qemukvm.sh b/os-plugins/plugins/qemukvm/XX_qemukvm.sh
index 98311d72..c2fa835b 100644
--- a/os-plugins/plugins/qemukvm/XX_qemukvm.sh
+++ b/os-plugins/plugins/qemukvm/XX_qemukvm.sh
@@ -15,6 +15,18 @@
# check if the configuration file is available
if [ -e /initramfs/plugin-conf/qemukvm.conf ]; then
+ # check for the virtualization CPU features
+ if grep -q "svm" /proc/cpuinfo ; then
+ modprobe -q kvm_amd || error " * Loading of kvm_amd failed"
+ elif grep -q "vmx" /proc/cpuinfo ; then
+ modprobe -q kvm_intel || error " * Loading of kvm_intel failed"
+ else
+ error " * No virtualization extenstion found in this CPU. Thus using \
+qemu-kvm\n makes not much sense. Please enable the extension within your \
+machines\n BIOS or get another CPU." nonfatal
+ exit 1
+ fi
+
# load needed variables
. /initramfs/plugin-conf/qemukvm.conf
@@ -34,7 +46,7 @@ if [ -e /initramfs/plugin-conf/qemukvm.conf ]; then
fi
if [ -n "${qkimgserv}" ] ; then
# directory where qemu images are expected in
- testmkd /mnt/var/lib/qemukvm
+ testmkd /mnt/var/lib/virt/qemukvm
case "${qkimgprot}" in
*nbd)
# TODO: to be filled in ...
@@ -45,7 +57,7 @@ if [ -e /initramfs/plugin-conf/qemukvm.conf ]; then
qkbdev=/dev/${qkimgserv}
waitfor ${qkbdev} 20000
echo -e "ext2\nreiserfs\nvfat\nxfs" >/etc/filesystems
- mount -o ro ${qkbdev} /mnt/var/lib/qemukvm || \
+ mount -o ro ${qkbdev} /mnt/var/lib/virt/qemukvm || \
error "$scfg_evmlm" nonfatal
;;
*)
@@ -54,7 +66,7 @@ if [ -e /initramfs/plugin-conf/qemukvm.conf ]; then
[ $proto = "fail" ] && { error "$scfg_nfs" nonfatal;
noimg=yes; break;}
mount -n -t nfs -o ro,nolock,$proto ${qkimgserv}:${qkimgpath} \
- /mnt/var/lib/qemukvm && break
+ /mnt/var/lib/virt/qemukvm && break
done
;;
esac
diff --git a/os-plugins/plugins/qemukvm/files/run-virt.include b/os-plugins/plugins/qemukvm/files/run-virt.include
index a4ce79ee..13e5deb9 100644
--- a/os-plugins/plugins/qemukvm/files/run-virt.include
+++ b/os-plugins/plugins/qemukvm/files/run-virt.include
@@ -16,15 +16,14 @@
permem=66
-mem=expr(${totalmem} * ${permem})
+mem=$(expr ${totalmem} * ${permem})
VIRTCMDOPTS="${VIRTCMDOPTS} -m ${mem}"
# virtual fd/cd/dvd and drive devices, floppy b: for configuration
#floppya is always false, if we have a floppy device or not isn't
#important.
-floppya="FALSE"
-floppyb="TRUE"
-floppybname="/etc/vmware/loopimg/fd.img"
+#VIRTCMDOPTS="${VIRTCMDOPTS} -fda /dev/fd0"
+VIRTCMDOPTS="${VIRTCMDOPTS} -fdb /var/lib/virt/vmchooser/loopimg/fd.img"
cdr_1="FALSE"
cdr_2="FALSE"
# ide is expected default, test for the virtual disk image type should
@@ -32,14 +31,17 @@ cdr_2="FALSE"
ide="TRUE"
hddrv="ide"
+# audio
+VIRTCMDOPTS="${VIRTCMDOPTS} -soundhw es1370"
-# Folder of VirtualMachine images
-vmdir="/var/lib/virt/qemukvm"
-
-# vmware image file
-diskfile="${vmdir}/${imagename}"
+# serial
+#VIRTCMDOPTS="${VIRTCMDOPTS} -serial /dev/ttyS0"
# set the variables appropriately
-VIRTCMD=$(which kvm)
-VIRTCMDOPTS="${VIRTCMDOPTS} ${imagename}"
+for i in kvm qemu-kvm qemu; do
+ VIRTCMD=$(which kvm 2>/dev/null)
+ [ -n $VIRTCMD ] && break
+done
+[ -n $VIRTCMD ] && { writelog "No qemu/kvm tool found."; exit 1; }
+VIRTCMDOPTS="${VIRTCMDOPTS} -boot c -alt-grab ${diskfile}"