All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Justinien Bouron <justinien.bouron@gmail.com>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
	"Daniel P. Berrangé" <berrange@redhat.com>,
	"Eduardo Habkost" <eduardo@habkost.net>,
	"Eric Blake" <eblake@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH] input-linux: Add option to not grab a device upon guest startup
Date: Fri, 15 Mar 2024 07:07:20 +0100	[thread overview]
Message-ID: <875xxoni3r.fsf@pond.sub.org> (raw)
In-Reply-To: <20240307062823.2377318-1-justinien.bouron@gmail.com> (Justinien Bouron's message of "Wed, 6 Mar 2024 22:28:22 -0800")

Justinien Bouron <justinien.bouron@gmail.com> writes:

> Depending on your use-case, it might be inconvenient to have qemu grab
> the input device immediately upon starting the guest, especially if the
> guest takes a while to start in which case it may take a few seconds
> before being able to release the device via the toggle combination.
>
> Added a new bool option to input-linux: grab-on-startup. If true, the
> device is grabbed as soon as the guest is started, otherwise it is not
> grabbed until the toggle combination is entered. To avoid breaking
> existing setups, the default value of grab-on-startup is true, ie. same
> behaviour as before this change.
>
> Signed-off-by: Justinien Bouron <justinien.bouron@gmail.com>
> ---
>  qapi/qom.json    | 13 ++++++++++++-
>  ui/input-linux.c | 20 +++++++++++++++++++-
>  2 files changed, 31 insertions(+), 2 deletions(-)
>
> diff --git a/qapi/qom.json b/qapi/qom.json
> index 032c6fa037..50e66d55cc 100644
> --- a/qapi/qom.json
> +++ b/qapi/qom.json
> @@ -508,13 +508,24 @@
>  # @grab-toggle: the key or key combination that toggles device grab
>  #     (default: ctrl-ctrl)
>  #
> +# @grab-on-startup: if true, grab the device immediately upon starting the
> +#     guest. Otherwise, don't grab the device until the combination is entered.
> +#     This does not influence other devices even if grab_all is true, ie. in the

i.e.

> +#     unlikely scenario where device1 has grab_all=true + grab-on-startup=true
> +#     and device2 has grab-on-startup=false, only device1 is grabbed on startup,
> +#     then, once the grab combination is entered, grabbing is toggled off for
> +#     both devices (because device1 enforces the grab_all property) until the
> +#     combination is entered again at which point both devices will be grabbed.
> +#     (default: true).

From docs/devel/qapi-code-gen.rst section Documentation markup:

    For legibility, wrap text paragraphs so every line is at most 70
    characters long.

    Separate sentences with two spaces.

> +

No blank lines in the middle of comment blocks, please.

>  # Since: 2.6
>  ##

Together:

   # @grab-on-startup: if true, grab the device immediately upon starting
   #     the guest.  Otherwise, don't grab the device until the
   #     combination is entered.  This does not influence other devices
   #     even if grab_all is true, i.e. in the unlikely scenario where
   #     device1 has grab_all=true + grab-on-startup=true and device2 has
   #     grab-on-startup=false, only device1 is grabbed on startup, then,
   #     once the grab combination is entered, grabbing is toggled off
   #     for both devices (because device1 enforces the grab_all
   #     property) until the combination is entered again at which point
   #     both devices will be grabbed.  (default: true).
   #
   # Since: 2.6
   ##

>  { 'struct': 'InputLinuxProperties',
>    'data': { 'evdev': 'str',
>              '*grab_all': 'bool',
>              '*repeat': 'bool',
> -            '*grab-toggle': 'GrabToggleKeys' } }
> +            '*grab-toggle': 'GrabToggleKeys',
> +            '*grab-on-startup': 'bool'} }
>  
>  ##
>  # @EventLoopBaseProperties:

[...]



      parent reply	other threads:[~2024-03-15  6:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07  6:28 [PATCH] input-linux: Add option to not grab a device upon guest startup Justinien Bouron
2024-03-07  9:54 ` Daniel P. Berrangé
2024-03-08  3:38   ` Justinien Bouron
2024-03-08  8:42     ` Daniel P. Berrangé
2024-03-08 14:34       ` Justinien Bouron
2024-03-15  2:36 ` Justinien Bouron
2024-03-15  6:06   ` Marc-André Lureau
2024-03-15  6:07 ` Markus Armbruster [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=875xxoni3r.fsf@pond.sub.org \
    --to=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=eblake@redhat.com \
    --cc=eduardo@habkost.net \
    --cc=justinien.bouron@gmail.com \
    --cc=kraxel@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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.