qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: Thomas Huth <thuth@redhat.com>, qemu-devel@nongnu.org
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Daniel P . Berrangé" <berrange@redhat.com>
Subject: Re: [PATCH] qemu-options: Deprecate "-runas" and introduce "-run-with user=..." instead
Date: Tue, 16 Apr 2024 13:13:58 +0200	[thread overview]
Message-ID: <9c5666a3-e4ae-4be0-bf1f-be7d36fa80a6@linaro.org> (raw)
In-Reply-To: <20240415183942.195781-1-thuth@redhat.com>

On 15/4/24 20:39, Thomas Huth wrote:
> The old "-runas" option has the disadvantage that it is not visible
> in the QAPI schema, so it is not available via the normal introspection
> mechanisms. We've recently introduced the "-run-with" option for exactly
> this purpose, which is meant to handle the options that affect the
> runtime behavior. Thus let's introduce a "user=..." parameter here now
> and deprecate the old "-runas" option.
> 
> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>   docs/about/deprecated.rst |  6 ++++++
>   system/vl.c               | 15 +++++++++++++++
>   qemu-options.hx           | 11 +++++++++--
>   3 files changed, 30 insertions(+), 2 deletions(-)


> diff --git a/qemu-options.hx b/qemu-options.hx
> index 8ce85d4559..50912c7dab 100644
> --- a/qemu-options.hx
> +++ b/qemu-options.hx
> @@ -4824,7 +4824,8 @@ DEF("runas", HAS_ARG, QEMU_OPTION_runas, \
>   SRST
>   ``-runas user``
>       Immediately before starting guest execution, drop root privileges,
> -    switching to the specified user.
> +    switching to the specified user. This option is deprecated, use
> +    ``-run-with user=...`` instead.
>   ERST
>   
>   DEF("prom-env", HAS_ARG, QEMU_OPTION_prom_env,
> @@ -4993,7 +4994,9 @@ DEF("run-with", HAS_ARG, QEMU_OPTION_run_with,
>       "-run-with [async-teardown=on|off][,chroot=dir]\n"

"-run-with [async-teardown=on|off][,chroot=dir][user=username|uid:gid]\n"

>       "                Set miscellaneous QEMU process lifecycle options:\n"
>       "                async-teardown=on enables asynchronous teardown (Linux only)\n"
> -    "                chroot=dir chroot to dir just before starting the VM\n",
> +    "                chroot=dir chroot to dir just before starting the VM\n"
> +    "                user=username switch to the specified user before starting the VM\n"
> +    "                user=uid:gid dito, but use specified user-ID and group-ID instead\n",
>       QEMU_ARCH_ALL)
>   SRST
>   ``-run-with [async-teardown=on|off][,chroot=dir]``

Ditto.

> @@ -5013,6 +5016,10 @@ SRST
>       ``chroot=dir`` can be used for doing a chroot to the specified directory
>       immediately before starting the guest execution. This is especially useful
>       in combination with -runas.
> +
> +    ``user=username`` or ``user=uid:gid`` can be used to drop root privileges
> +    by switching to the specified user (via username) or user and group
> +    (via uid:gid) immediately before starting guest execution.
>   ERST
>   #endif
>   



      reply	other threads:[~2024-04-16 11:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-15 18:39 [PATCH] qemu-options: Deprecate "-runas" and introduce "-run-with user=..." instead Thomas Huth
2024-04-16 11:13 ` Philippe Mathieu-Daudé [this message]

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=9c5666a3-e4ae-4be0-bf1f-be7d36fa80a6@linaro.org \
    --to=philmd@linaro.org \
    --cc=berrange@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=thuth@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).