vmstop function generated and ready to test
This commit is contained in:
parent
098b8f2a2e
commit
714882ba4c
42
nlvmi
42
nlvmi
|
@ -140,22 +140,22 @@ function vmstart {
|
||||||
USBDEV3=""; fi
|
USBDEV3=""; fi
|
||||||
if [ ${array[23]}!="" ]; then
|
if [ ${array[23]}!="" ]; then
|
||||||
USBDEV3="-usbdevice ${array[22]}"; fi
|
USBDEV3="-usbdevice ${array[22]}"; fi
|
||||||
if [ ${array[29]}=="" ]; then
|
|
||||||
CPUTYPE=""; fi
|
|
||||||
if [ ${array[29]}!="" ]; then
|
|
||||||
CPUTYPE="-cpu ${array[29]}"; fi
|
|
||||||
if [ ${array[27]}=="" ]; then
|
|
||||||
SMP=""; fi
|
|
||||||
if [ ${array[27]}!="" ]; then
|
|
||||||
SMP="-smp ${array[27]}"; fi
|
|
||||||
if [ ${array[26]}=="" ]; then
|
|
||||||
MEMORY=""; fi
|
|
||||||
if [ ${array[26]}!="" ]; then
|
|
||||||
MEMORY="-m ${array[26]}"; fi
|
|
||||||
if [ ${array[28]}=="" ]; then
|
if [ ${array[28]}=="" ]; then
|
||||||
CUSTOM=""; fi
|
CPUTYPE=""; fi
|
||||||
if [ ${array[28]}!="" ]; then
|
if [ ${array[28]}!="" ]; then
|
||||||
CUSTOM="${array[28]}"; fi
|
CPUTYPE="-cpu ${array[28]}"; fi
|
||||||
|
if [ ${array[26]}=="" ]; then
|
||||||
|
SMP=""; fi
|
||||||
|
if [ ${array[26]}!="" ]; then
|
||||||
|
SMP="-smp ${array[26]}"; fi
|
||||||
|
if [ ${array[25]}=="" ]; then
|
||||||
|
MEMORY=""; fi
|
||||||
|
if [ ${array[25]}!="" ]; then
|
||||||
|
MEMORY="-m ${array[25]}"; fi
|
||||||
|
if [ ${array[27]}=="" ]; then
|
||||||
|
CUSTOM=""; fi
|
||||||
|
if [ ${array[27]}!="" ]; then
|
||||||
|
CUSTOM="${array[27]}"; fi
|
||||||
tunctl -t $TAPDEV1 -u ${array[3]}
|
tunctl -t $TAPDEV1 -u ${array[3]}
|
||||||
brctl addif br0 $TAPDEV1
|
brctl addif br0 $TAPDEV1
|
||||||
ifconfig $TAPDEV1 up
|
ifconfig $TAPDEV1 up
|
||||||
|
@ -167,6 +167,20 @@ function vmstart {
|
||||||
export VMFOUND="yes"
|
export VMFOUND="yes"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function vmstop {
|
||||||
|
if [ -e $RUNDIRDIRECTORY/$1.pid ]; then echo "pidfile not exist"; exit 1; fi
|
||||||
|
if [ $LOGLEVEL -gt "1" ]; then echo "stopvm function entered for VM $1"; fi
|
||||||
|
sqlite3 $SQLITEFILE "SELECT * FROM vms WHERE vmname=$1" | while read line; do
|
||||||
|
IFS='|' read -r -a array <<< "$line"
|
||||||
|
echo "system_powerdown" | socat - unix-connect:$RUNDIRDIRECTORY/${array[1]}.mon >/dev/null
|
||||||
|
STOPPED="no"
|
||||||
|
while [ $STOPPED = "no" ]; do
|
||||||
|
ps -ef | grep `cat $RUNDIRDIRECTORY/${array[1]}.pid` | grep -v grep >/dev/null || STOPPED="yes"
|
||||||
|
done
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
#mainloop
|
#mainloop
|
||||||
if [ $# -gt 0 ]; then
|
if [ $# -gt 0 ]; then
|
||||||
if [ $1 == "createdb" ]; then
|
if [ $1 == "createdb" ]; then
|
||||||
|
|
Loading…
Reference in New Issue