summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xkvm-wrapper.sh10
1 files changed, 9 insertions, 1 deletions
diff --git a/kvm-wrapper.sh b/kvm-wrapper.sh
index f8c0c50..51ba179 100755
--- a/kvm-wrapper.sh
+++ b/kvm-wrapper.sh
@@ -853,6 +853,8 @@ function kvm_migrate_vm ()
! test_socket_rw "$MONITOR_FILE" && fail_exit "Error: could not open monitor socket $MONITOR_FILE."
[[ "$KVM_CLUSTER_NODE" == "$REMOTE_NODE" ]] && fail_exit "Error: $VM_NAME already runs on $REMOTE_NODE!"
[[ -z "`get_cluster_host $REMOTE_NODE`" ]] && fail_exit "Error: Unknown host $REMOTE_NODE!"
+
+ [[ -n "${KVM_PCIASSIGN_DOMAIN[@]}" ]] && fail_exit "Cannot migrate vm with pci passthrough!"
# Update VM configuration with new node
desc_update_setting "KVM_CLUSTER_NODE" "$REMOTE_NODE"
@@ -955,10 +957,16 @@ function kvm_build_vm ()
;;
esac
done
- if [[ ! "$#" -eq 1 ]]; then print_help "create"; exit 1; fi
+ if [[ ! "$#" -eq 1 ]]; then print_help "create"; return 1; fi
VM_NAME="$1"
+ if [[ "$VM_NAME" == -* ]]; then
+ echo "VM name $VM_NAME starts with a dash, you probably didn't want that"
+ print_help "create"
+ return 1
+ fi
+
test_file "$AUTOCONF_SCRIPT" || fail_exit "Couldn't read autoconfiguration script $AUTOCONF_SCRIPT\n"
kvm_create_descriptor "$VM_NAME"