defconf VIRSH "virsh -c qemu:///system" \
"<cmd>" "how to invoke virsh"
-# the kvm binary to use - should be a very recent version
-# I am using a git snapshot from http://kvm.qumranet.com/kvmwiki/Code
-defconf KVM "/usr/bin/qemu-kvm" \
+defconf KVM "@uto" \
"<file>" "location of KVM executable"
defconf KVMLOG "/var/log/kvm" \
EOF
}
+get_kvm_path ()
+{
+ local t
+
+ if t=$(which qemu-kvm 2>/dev/null) ; then
+ echo "$t"
+ elif t=$(which kvm 2>/dev/null) ; then
+ echo "$t"
+ elif [ -x "/usr/libexec/qemu-kvm" ] ; then
+ echo "/usr/libexec/qemu-kvm"
+ else
+ die "Could not find KVM executable"
+ fi
+
+}
+
rhel_post_config_hook ()
{
if [ "$ISO" = "@uto" ] ; then
if [ "$SYSTEM_DISK_PREFIX" = "@uto" ] ; then
SYSTEM_DISK_PREFIX=$(rhel_disk_prefix $SYSTEM_DISK_TYPE)
fi
+
+ if [ "$KVM" = "@uto" ] ; then
+ KVM=$(get_kvm_path) || exit $?
+ fi
}
register_hook post_config_hooks rhel_post_config_hook