]> git.proxmox.com Git - qemu.git/commit
qga: Fix shutdown command of guest agent to work with SysV
authorwhitearchey <whitearchey@gmail.com>
Wed, 6 Nov 2013 01:54:04 +0000 (10:54 +0900)
committerMichael Tokarev <mjt@tls.msk.ru>
Sat, 16 Nov 2013 10:04:45 +0000 (14:04 +0400)
commit485e741cd15655b4032b07b8a912aa5c7a4f2028
tree2cc77f3bdf284f381ab80c190cee979492da1418
parent3325a83627de3e3bd9a97548f13bbb53b354d970
qga: Fix shutdown command of guest agent to work with SysV

For now guest agent uses following command to shutdown system:
shutdown -P +0 "blabla"
but this syntax works only with shutdown command from systemd or upstart,
because SysV shutdown requires -h switch.

Following patch changes the command so it works with systemd, upstart and SysV

With upstart/systemd qga use one of thee commands, depending on 'mode' parameter:
  shutdown -P +0 "..."
  shutdown -H +0 "..."
  shutdown -r +0 "..."
SysV equivalents for these are:
  shutdown -h -P +0 "..."
  shutdown -h -H +0 "..."
  shutdown -h -r +0 "..."
and these retain their meaning with upstart/systemd.

According to FreeBSD manpages, shutdown does not accept -P and -H options. Commands should be:
  shutdown -p +0 "..."
  shutdown -h +0 "..."
  shutdown -r +0 "..."

shutdown in Solaris does not accept any of -hHpPr and does not accept time in "+0" format

Signed-off-by: Michael Avdienko <whitearchey@gmail.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
qga/commands-posix.c