ea98408a65ef25f87c1f1046e19fd4b14765c8b4
[ovsnfv.git] / fuel-plugin-ovsnfv / deployment_scripts / puppet / modules / ovsdpdk / files / kvm-wrapper.sh
1 #!/usr/bin/env bash
2 VIRTIO_OPTIONS="csum=off,gso=off,guest_tso4=off,guest_tso6=off,guest_ecn=off"
3 VHOST_FORCE="vhostforce"
4 SHARE="share=on"
5 add_mem=False
6 i=0
7 while [ $# -gt 0 ]; do
8      case "$1" in
9
10      -device)
11         args[i]="$1"
12         (( i++ ))
13         shift
14         if [[ $1 =~ "vhost-user" ]]
15         then
16                 args[i]=${1},${VHOST_FORCE}
17                 (( i++))
18                 shift
19
20         fi
21         ;;
22     -object)
23         args[i]="$1"
24         (( i++ ))
25         shift
26         if [[ $1 =~ "memory-backend-file" ]]
27         then
28                 args[i]=${1},${SHARE}
29                 (( i++))
30                 shift
31
32         fi
33         ;;
34
35      *)
36          args[i]="$1"
37          (( i++ ))
38          shift ;;
39      esac
40 done
41 echo "qemu ${args[@]}"  > /tmp/qemu.orig
42 if [ -e /usr/bin/qemu-system-x86_64 ]; then
43     exec /usr/bin/qemu-system-x86_64  "${args[@]}"
44 elif [ -e /usr/libexec/qemu-kvm.orig ]; then
45     exec /usr/libexec/qemu-kvm.orig  "${args[@]}"
46 fi