[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 4/8] qga: Add shutdown/halt/reboot support for FreeBSD
From: |
Konstantin Kostiuk |
Subject: |
[PULL 4/8] qga: Add shutdown/halt/reboot support for FreeBSD |
Date: |
Wed, 26 Oct 2022 20:55:14 +0300 |
From: Alexander Ivanov <alexander.ivanov@virtuozzo.com>
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>
---
qga/commands-posix.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 6875ea8888..b0b467ebdb 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -90,6 +90,10 @@ void qmp_guest_shutdown(bool has_mode, const char *mode,
Error **errp)
const char *powerdown_flag = "-i5";
const char *halt_flag = "-i0";
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
const char *powerdown_flag = "-P";
const char *halt_flag = "-H";
@@ -120,6 +124,9 @@ void qmp_guest_shutdown(bool has_mode, const char *mode,
Error **errp)
#ifdef CONFIG_SOLARIS
execl("/sbin/shutdown", "shutdown", shutdown_flag, "-g0", "-y",
"hypervisor initiated shutdown", (char *)NULL);
+#elif defined(CONFIG_BSD)
+ execl("/sbin/shutdown", "shutdown", shutdown_flag, "+0",
+ "hypervisor initiated shutdown", (char *)NULL);
#else
execl("/sbin/shutdown", "shutdown", "-h", shutdown_flag, "+0",
"hypervisor initiated shutdown", (char *)NULL);
--
2.25.1
- [PULL 0/8] QEMU Guest Agent patches, Konstantin Kostiuk, 2022/10/26
- [PULL 2/8] qga: Move Linux-specific FS freeze/thaw code to a separate file, Konstantin Kostiuk, 2022/10/26
- [PULL 3/8] qga: Add UFS freeze/thaw support for FreeBSD, Konstantin Kostiuk, 2022/10/26
- [PULL 4/8] qga: Add shutdown/halt/reboot support for FreeBSD,
Konstantin Kostiuk <=
- [PULL 1/8] qga: Add initial FreeBSD support, Konstantin Kostiuk, 2022/10/26
- [PULL 5/8] qga: Add support for user password setting in FreeBSD, Konstantin Kostiuk, 2022/10/26
- [PULL 8/8] qga: add channel path to error messages, Konstantin Kostiuk, 2022/10/26
- [PULL 7/8] qga: Add HW address getting for FreeBSD, Konstantin Kostiuk, 2022/10/26
- [PULL 6/8] qga: Move HW address getting to a separate function, Konstantin Kostiuk, 2022/10/26
- Re: [PULL 0/8] QEMU Guest Agent patches, Stefan Hajnoczi, 2022/10/31