mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
scripts: Add an option to accept hypervisor argument
Signed-off-by: Muminul Islam <muislam@microsoft.com>
This commit is contained in:
committed by
Samuel Ortiz
parent
2cc312b65c
commit
27b5f8d7e3
34
scripts/test-util.sh
Normal file
34
scripts/test-util.sh
Normal file
@@ -0,0 +1,34 @@
|
||||
#!/bin/bash
|
||||
hypervisor="kvm"
|
||||
cmd_help() {
|
||||
echo ""
|
||||
echo "Cloud Hypervisor $(basename $0)"
|
||||
echo "Usage: $(basename $0) [<args>]"
|
||||
echo ""
|
||||
echo "Available arguments:"
|
||||
echo ""
|
||||
echo " --hypervisor Underlying hypervisor. Options kvm, mshv"
|
||||
echo ""
|
||||
echo " --help Display this help message."
|
||||
echo ""
|
||||
}
|
||||
|
||||
process_common_args() {
|
||||
while [ $# -gt 0 ]; do
|
||||
case "$1" in
|
||||
"-h"|"--help") { cmd_help; exit 1; } ;;
|
||||
"--hypervisor")
|
||||
shift
|
||||
hypervisor="$1"
|
||||
;;
|
||||
*)
|
||||
# We only care about hypervisor , do nothing for other arguments
|
||||
;;
|
||||
esac
|
||||
shift
|
||||
done
|
||||
if [[ "$hypervisor" != "kvm" ]]; then
|
||||
echo "Hypervisor value must be kvm"
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
Reference in New Issue
Block a user