qga/commands-posix: 'guest-shutdown' for Solaris
authorAndrew Deason <adeason@sinenomine.net>
Tue, 26 Apr 2022 19:55:26 +0000 (14:55 -0500)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Wed, 4 May 2022 08:00:46 +0000 (12:00 +0400)
commitc8ec041d0006ef3e930840f7c62869a1e44c5ced
treedcfaad70616147c9f5cb450aa065ad8b7b8ebe8a
parenta539dc8a2c76dc8f04585a265e07af6ebaa4b86a
qga/commands-posix: 'guest-shutdown' for Solaris

On Solaris, instead of the -P, -H, and -r flags, we need to provide
the target init state to the 'shutdown' command: state 5 is poweroff,
0 is halt, and 6 is reboot. We also need to pass -g0 to avoid the
default 60-second delay, and -y to avoid a confirmation prompt.

Implement this logic under an #ifdef CONFIG_SOLARIS, so the
'guest-shutdown' command works properly on Solaris.

Signed-off-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220426195526.7699-6-adeason@sinenomine.net>
qga/commands-posix.c