qga: Add shutdown/halt/reboot support for FreeBSD
Add appropriate shutdown command arguments to qmp_guest_shutdown() for FreeBSD. Reviewed-by: Konstantin Kostiuk <kkostiuk@redhat.com> Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Alexander Ivanov <alexander.ivanov@virtuozzo.com> Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com>
This commit is contained in:
parent
bad0001eeb
commit
e40762fcd6
|
@ -90,6 +90,10 @@ void qmp_guest_shutdown(bool has_mode, const char *mode, Error **errp)
|
||||||
const char *powerdown_flag = "-i5";
|
const char *powerdown_flag = "-i5";
|
||||||
const char *halt_flag = "-i0";
|
const char *halt_flag = "-i0";
|
||||||
const char *reboot_flag = "-i6";
|
const char *reboot_flag = "-i6";
|
||||||
|
#elif defined(CONFIG_BSD)
|
||||||
|
const char *powerdown_flag = "-p";
|
||||||
|
const char *halt_flag = "-h";
|
||||||
|
const char *reboot_flag = "-r";
|
||||||
#else
|
#else
|
||||||
const char *powerdown_flag = "-P";
|
const char *powerdown_flag = "-P";
|
||||||
const char *halt_flag = "-H";
|
const char *halt_flag = "-H";
|
||||||
|
@ -120,6 +124,9 @@ void qmp_guest_shutdown(bool has_mode, const char *mode, Error **errp)
|
||||||
#ifdef CONFIG_SOLARIS
|
#ifdef CONFIG_SOLARIS
|
||||||
execl("/sbin/shutdown", "shutdown", shutdown_flag, "-g0", "-y",
|
execl("/sbin/shutdown", "shutdown", shutdown_flag, "-g0", "-y",
|
||||||
"hypervisor initiated shutdown", (char *)NULL);
|
"hypervisor initiated shutdown", (char *)NULL);
|
||||||
|
#elif defined(CONFIG_BSD)
|
||||||
|
execl("/sbin/shutdown", "shutdown", shutdown_flag, "+0",
|
||||||
|
"hypervisor initiated shutdown", (char *)NULL);
|
||||||
#else
|
#else
|
||||||
execl("/sbin/shutdown", "shutdown", "-h", shutdown_flag, "+0",
|
execl("/sbin/shutdown", "shutdown", "-h", shutdown_flag, "+0",
|
||||||
"hypervisor initiated shutdown", (char *)NULL);
|
"hypervisor initiated shutdown", (char *)NULL);
|
||||||
|
|
Loading…
Reference in New Issue