[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 16/16] qga: Fix shutdown command of guest agent to wo
From: |
Michael Tokarev |
Subject: |
[Qemu-devel] [PULL 16/16] qga: Fix shutdown command of guest agent to work with SysV |
Date: |
Wed, 13 Nov 2013 17:01:20 +0400 |
From: whitearchey <address@hidden>
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 <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
qga/commands-posix.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index f453132..10682f5 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -99,7 +99,7 @@ void qmp_guest_shutdown(bool has_mode, const char *mode,
Error **err)
reopen_fd_to_null(1);
reopen_fd_to_null(2);
- execle("/sbin/shutdown", "shutdown", shutdown_flag, "+0",
+ execle("/sbin/shutdown", "shutdown", "-h", shutdown_flag, "+0",
"hypervisor initiated shutdown", (char*)NULL, environ);
_exit(EXIT_FAILURE);
} else if (pid < 0) {
--
1.7.10.4
- [Qemu-devel] [PULL 01/16] qemu-char: add Czech characters to VNC keysyms, (continued)
- [Qemu-devel] [PULL 01/16] qemu-char: add Czech characters to VNC keysyms, Michael Tokarev, 2013/11/13
- [Qemu-devel] [PULL 03/16] qemu-char: add support for U-prefixed symbols, Michael Tokarev, 2013/11/13
- [Qemu-devel] [PULL 04/16] qemu-char: add missing characters used in keymaps, Michael Tokarev, 2013/11/13
- [Qemu-devel] [PULL 07/16] qapi: Fix comment for create-type to match code., Michael Tokarev, 2013/11/13
- [Qemu-devel] [PULL 13/16] trace: Remove trace.h from hw/usb/hcd-ehci.h (less dependencies), Michael Tokarev, 2013/11/13
- [Qemu-devel] [PULL 11/16] console: Remove unused debug code, Michael Tokarev, 2013/11/13
- [Qemu-devel] [PULL 15/16] gtk: Replace conditional debug messages by trace methods, Michael Tokarev, 2013/11/13
- [Qemu-devel] [PULL 09/16] .travis.yml: basic compile and check recipes, Michael Tokarev, 2013/11/13
- [Qemu-devel] [PULL 06/16] vl: fix build when configured with no graphic support, Michael Tokarev, 2013/11/13
- [Qemu-devel] [PULL 05/16] usb: drop unused USBNetState.inpkt field, Michael Tokarev, 2013/11/13
- [Qemu-devel] [PULL 16/16] qga: Fix shutdown command of guest agent to work with SysV,
Michael Tokarev <=
- [Qemu-devel] [PULL 12/16] trace: Remove trace.h from console.h (less dependencies), Michael Tokarev, 2013/11/13
- [Qemu-devel] [PULL 14/16] console: Replace conditional debug messages by trace methods, Michael Tokarev, 2013/11/13
- [Qemu-devel] [PULL 08/16] pci-assign: Fix error_report of pci-stub message, Michael Tokarev, 2013/11/13
- Re: [Qemu-devel] [PULL 00/16] [for-1.7] Trivial patches for 2013-11-13, Stefan Weil, 2013/11/13