mirror_qemu/qga
whitearchey 485e741cd1 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>
2013-11-16 14:04:45 +04:00
..
vss-win32 qga: Fix compilation for old versions of MinGW 2013-11-13 15:59:06 +04:00
Makefile.objs qemu-ga: Call Windows VSS requester in fsfreeze command handler 2013-09-09 14:17:57 -05:00
channel-posix.c qemu-ga: Handle errors uniformely in ga_channel_open() 2013-01-14 12:08:05 -06:00
channel-win32.c remove double semicolons 2013-05-12 13:25:55 +04:00
channel.h qemu-ga: move channel/transport functionality into wrapper class 2012-02-23 15:40:16 -06:00
commands-posix.c qga: Fix shutdown command of guest agent to work with SysV 2013-11-16 14:04:45 +04:00
commands-win32.c qemu-ga: Call Windows VSS requester in fsfreeze command handler 2013-09-09 14:17:57 -05:00
commands.c qemu-ga: Extend 'guest-info' command to expose flag 'success-response' 2013-10-10 14:52:37 -05:00
guest-agent-command-state.c Use glib memory allocation and free functions 2011-08-20 23:01:08 -05:00
guest-agent-core.h qemu-ga: use key-value store to avoid recycling fd handles after restart 2013-03-11 18:53:47 -05:00
main.c qemu-ga: Add interface to traverse the qmp command list by QmpCommand 2013-10-10 14:52:37 -05:00
qapi-schema.json qemu-ga: Extend 'guest-info' command to expose flag 'success-response' 2013-10-10 14:52:37 -05:00
service-win32.c qga: escape cmdline args when registering win32 service (CVE-2013-2231) 2013-07-25 14:49:04 -05:00
service-win32.h qga: save state directory in ga_install_service() 2013-05-30 11:37:37 -05:00
vss-win32.c qemu-ga: Install Windows VSS provider on `qemu-ga -s install' 2013-09-09 14:17:57 -05:00
vss-win32.h qemu-ga: Install Windows VSS provider on `qemu-ga -s install' 2013-09-09 14:17:57 -05:00