diff options
-rwxr-xr-x | kvmx | 24 |
1 files changed, 18 insertions, 6 deletions
@@ -200,12 +200,24 @@ function __kvmx_initialize { mkdir -p $STATE_DIR $LOG_DIR - if [ ! -e "$image" ] && [ "$ACTION" != "up" ] && [ "$ACTION" != "provision" ] && [ "$ACTION" != "purge" ] \ - && [ "$ACTION" != "destroy" ] && [ "$ACTION" != "install" ] && [ "$ACTION" != "config" ] \ - && [ "$ACTION" != "config_unset" ] && [ "$ACTION" != "create" ] && [ "$ACTION" != "shell" ] \ - && [ "$ACTION" != "boot" ]; then - echo "$BASENAME: file not found: $image" - exit 1 + # Additional checks + if [ "$ACTION" != "up" ] && [ "$ACTION" != "provision" ] && [ "$ACTION" != "purge" ] && \ + [ "$ACTION" != "destroy" ] && [ "$ACTION" != "install" ] && [ "$ACTION" != "config" ] && \ + [ "$ACTION" != "config_unset" ] && [ "$ACTION" != "create" ] && [ "$ACTION" != "shell" ] && \ + [ "$ACTION" != "boot" ]; then + if [ ! -e "$image" ]; then + echo "$BASENAME: file not found: $image" + exit 1 + fi + + # See http://www.linux-kvm.org/page/FAQ + if ! egrep -q '^flags.*(vmx|svm)' /proc/cpuinfo; then + echo "$BASENAME: WARNING: Intel VT or AMD-V not present at /proc/cpuinfo, expect slow performance" + fi + + if ! groups `whoami` | grep -q 'kvm'; then + echo "$BASENAME: WARNING: user `whoami` not in kvm group, expect slow performance" + fi fi fi } |