2011-03-29 12:20:50 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
. "${PM_FUNCTIONS}"
|
|
|
|
|
|
|
|
suspend_net()
|
|
|
|
{
|
|
|
|
NETVM=$(qvm-get-default-netvm)
|
|
|
|
if [ "X"$NETVM = "X""dom0" -o "X"$NETVM = "X" -o "X"$NETVM = "X""none"] ; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
qvm-run -u root --pass_io $NETVM "source /usr/lib64/pm-utils/pm-functions; run_hooks sleep suspend suspend"
|
2011-03-29 12:22:31 +02:00
|
|
|
# Ignore exit status from netvm...
|
|
|
|
return 0
|
2011-03-29 12:20:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
resume_net()
|
|
|
|
{
|
|
|
|
NETVM=$(qvm-get-default-netvm)
|
|
|
|
if [ "X"$NETVM = "X""dom0" -o "X"$NETVM = "X" -o "X"$NETVM = "X""none"] ; then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
qvm-run -u root --pass_io $NETVM "source /usr/lib64/pm-utils/pm-functions; run_hooks sleep resume suspend reverse"
|
2011-03-29 12:22:31 +02:00
|
|
|
# Ignore exit status from netvm...
|
|
|
|
return 0
|
2011-03-29 12:20:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
resume) resume_net ;;
|
|
|
|
suspend) suspend_net ;;
|
|
|
|
*) exit 0 ;;
|
|
|
|
esac
|