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, 06 Nov 2013 13:20:36 +0400	[thread overview]
Message-ID: <527A09E4.7090605@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

While the patch is one-liner indeed, it is a bit more than trivial.
Because it changes things in a non-obvious way, especially when
multiple systems are concerned.  Cc'ing qemu-devel@ due to this.

> --- a/qga/commands-posix.c
> +++ b/qga/commands-posix.c
> -        execle("/sbin/shutdown", "shutdown", shutdown_flag, "+0",
> +        execle("/sbin/shutdown", "shutdown", "-h", shutdown_flag, "+0",

Note that shutdown command is not in POSIX, despite the fact
that this is put into commands-posix.c

Note also that even shutdown from sysvinit on linux has another
option, -P, which mean poweroff, while -h means "halt OR poweroff"
(the latter is a bit unclear).

Does the same work on other *nixes?  *BSD?  Solaris?

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] [PATCH] qga: Fix shutdown command of guest agent to work with SysV
Date: Wed, 06 Nov 2013 13:20:36 +0400	[thread overview]
Message-ID: <527A09E4.7090605@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

While the patch is one-liner indeed, it is a bit more than trivial.
Because it changes things in a non-obvious way, especially when
multiple systems are concerned.  Cc'ing qemu-devel@ due to this.

> --- a/qga/commands-posix.c
> +++ b/qga/commands-posix.c
> -        execle("/sbin/shutdown", "shutdown", shutdown_flag, "+0",
> +        execle("/sbin/shutdown", "shutdown", "-h", shutdown_flag, "+0",

Note that shutdown command is not in POSIX, despite the fact
that this is put into commands-posix.c

Note also that even shutdown from sysvinit on linux has another
option, -P, which mean poweroff, while -h means "halt OR poweroff"
(the latter is a bit unclear).

Does the same work on other *nixes?  *BSD?  Solaris?

Thanks,

/mjt

  reply	other threads:[~2013-11-06  9:21 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 [this message]
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 ` [Qemu-trivial] " Michael Tokarev
2013-11-13 12:02   ` [Qemu-devel] " 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=527A09E4.7090605@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.