All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Tokarev <mjt@tls.msk.ru>
To: whitearchey <whitearchey@gmail.com>
Cc: qemu-trivial@nongnu.org, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-trivial] [PATCH] qga: Fix shutdown command of guest agent to work with SysV
Date: Wed, 13 Nov 2013 16:02:20 +0400	[thread overview]
Message-ID: <52836A4C.7040207@msgid.tls.msk.ru> (raw)
In-Reply-To: <op.w53t8fe2cb68cn@whitewind-arch>

06.11.2013 05:54, whitearchey wrote:
> 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
> 
> Signed-off-by: Michael Avdienko <whitearchey@gmail.com>
> ---
>  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) {

Applied to the trivial-patches queue, with additional comments from your
next email explaining which commands/flags are used by which shutdown command.

I guess we'll need some #ifdef SOLARIS..#ifdef *BSD here later, but for
now it should be fine as-is, since apparently both variants (before and after
your change) are linux-only anyway.

Thanks,

/mjt


WARNING: multiple messages have this Message-ID (diff)
From: Michael Tokarev <mjt@tls.msk.ru>
To: whitearchey <whitearchey@gmail.com>
Cc: qemu-trivial@nongnu.org, qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [Qemu-trivial] [PATCH] qga: Fix shutdown command of guest agent to work with SysV
Date: Wed, 13 Nov 2013 16:02:20 +0400	[thread overview]
Message-ID: <52836A4C.7040207@msgid.tls.msk.ru> (raw)
In-Reply-To: <op.w53t8fe2cb68cn@whitewind-arch>

06.11.2013 05:54, whitearchey wrote:
> 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
> 
> Signed-off-by: Michael Avdienko <whitearchey@gmail.com>
> ---
>  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) {

Applied to the trivial-patches queue, with additional comments from your
next email explaining which commands/flags are used by which shutdown command.

I guess we'll need some #ifdef SOLARIS..#ifdef *BSD here later, but for
now it should be fine as-is, since apparently both variants (before and after
your change) are linux-only anyway.

Thanks,

/mjt

  parent reply	other threads:[~2013-11-13 12:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-06  1:54 [Qemu-trivial] [PATCH] qga: Fix shutdown command of guest agent to work with SysV whitearchey
2013-11-06  9:20 ` Michael Tokarev
2013-11-06  9:20   ` [Qemu-devel] " Michael Tokarev
2013-11-07  2:45   ` [Qemu-trivial] " whitearchey
2013-11-07  2:45     ` [Qemu-devel] " whitearchey
2013-11-12  9:01     ` [Qemu-trivial] " whitearchey
2013-11-12  9:01       ` [Qemu-devel] " whitearchey
2013-11-13 12:02 ` Michael Tokarev [this message]
2013-11-13 12:02   ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52836A4C.7040207@msgid.tls.msk.ru \
    --to=mjt@tls.msk.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=whitearchey@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.