From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3A82FC64EC4 for ; Wed, 8 Mar 2023 14:01:04 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZuL7-0006CD-EN; Wed, 08 Mar 2023 09:00:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZuL5-0006Bg-43 for qemu-devel@nongnu.org; Wed, 08 Mar 2023 09:00:19 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pZuL3-00059v-DF for qemu-devel@nongnu.org; Wed, 08 Mar 2023 09:00:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678284015; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=GuYiNgcm28/bpZaMeH4ok28hRMXbeNsV/uE5Z3O9VTc=; b=RtdXjC+SkyMCK6FIDUBE5X3FiWiXEKztQwcU6OT6xTCN0i8dSefdrYZSr/aIvx/xl6S+hC QYJL93tFLyO12aQ4y4y5lzGbZrHuZEu5qopvaSa2s03tCR5ihyUhpHqxNe7zEiY+p9LEtF kIBCp/QKPOdHRQl+/6UmDTn+ABJV4RA= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-482-qaqYCHOYP4e7pUGBQUznaw-1; Wed, 08 Mar 2023 09:00:13 -0500 X-MC-Unique: qaqYCHOYP4e7pUGBQUznaw-1 Received: by mail-ed1-f70.google.com with SMTP id b7-20020a056402350700b004d2a3d5cd3fso18693654edd.8 for ; Wed, 08 Mar 2023 06:00:12 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678284011; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=GuYiNgcm28/bpZaMeH4ok28hRMXbeNsV/uE5Z3O9VTc=; b=A1YaiBCtG7zaGmRmHC0zl9fNMfJao/4XyLJbGL7WzuhV90xiUYFfX4QR6KyajSpzY+ kz8M6RXPWoxo5w8QYaqZznR50M4WU36D/78DaYdjNTBX888XsgU2g1F9nBeRw4bs7qWe H4Y+gP8e5QsCy/0tEImdSq3fkLFOFO2m44ZywjtphPDKx3d7D1uJIGPahI9ZXEbNrf46 We64JdxVwRaWrjaO4XHajWr/w+bDk+XiiWS3ID0uFFRGDNn8A+dM9pa7qXfkUVkLSnPu CXbuatb3SpNyO413lTeL4GA9YJ7PO1FNfir2Z5ctP6ZjfWTh21awQInuTqjbXVfsA3Id NaKA== X-Gm-Message-State: AO0yUKVYyD1xY3yOe1EkziQ2QWoNZ0M/s4vdFUV7QCRqRNGgVk6Sp7xd y01+8FWYpTy8oAR6BElzZdgb9j/vTa+pJDNygScfBKrv5LTCo2cjwY6hXJJaVd7nIyRDfsuTgqa 0swdpIFZ6fAebEgeZqaEQDvDJ0E/eRgE= X-Received: by 2002:a50:d5d6:0:b0:4af:70a5:5609 with SMTP id g22-20020a50d5d6000000b004af70a55609mr9753264edj.1.1678284011431; Wed, 08 Mar 2023 06:00:11 -0800 (PST) X-Google-Smtp-Source: AK7set8m0TUVidxMG2bCsDcYxl4QZgL2UPnsvLJXr9L6yY7YNL4PJSKqNoC+rTTuLzMXj9jjAiOsAFIjUcfuDFpdLUU= X-Received: by 2002:a50:d5d6:0:b0:4af:70a5:5609 with SMTP id g22-20020a50d5d6000000b004af70a55609mr9753255edj.1.1678284011219; Wed, 08 Mar 2023 06:00:11 -0800 (PST) MIME-Version: 1.0 References: <20230307145825.2544850-1-marcandre.lureau@redhat.com> <877cvrxs81.fsf@pond.sub.org> In-Reply-To: <877cvrxs81.fsf@pond.sub.org> From: =?UTF-8?B?TWFyYy1BbmRyw6kgTHVyZWF1?= Date: Wed, 8 Mar 2023 17:59:59 +0400 Message-ID: Subject: Re: [PATCH v3] qapi: give available enum values as error hint To: Markus Armbruster Cc: qemu-devel@nongnu.org, Michael Roth Content-Type: multipart/alternative; boundary="00000000000052484b05f663f27c" Received-SPF: pass client-ip=170.10.133.124; envelope-from=mlureau@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org --00000000000052484b05f663f27c Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi On Wed, Mar 8, 2023 at 5:55=E2=80=AFPM Markus Armbruster wrote: > marcandre.lureau@redhat.com writes: > > > From: Marc-Andr=C3=A9 Lureau > > > > This allows for a more pleasant user experience. > > > > Before: > > $ ./qemu-system-x86_64 -display egl-headless,gl=3D > > qemu-system-x86_64: -display egl-headless,gl=3D: Parameter 'gl' does no= t > accept value '' > > > > After: > > $ ./qemu-system-x86_64 -display egl-headless,gl=3D > > qemu-system-x86_64: -display egl-headless,gl=3D: Parameter 'gl' does no= t > accept value '' > > Acceptable values are 'off', 'on', 'core', 'es' > > > > Signed-off-by: Marc-Andr=C3=A9 Lureau > > Nice improvement here. > > Slightly ugly: > > $ qemu-system-x86_64 -nic bad > upstream-qemu: -nic bad: Parameter 'type' does not accept value 'bad' > Acceptable values are 'none', 'nic', 'user', 'tap', 'l2tpv3', > 'socket', 'stream', 'dgram', 'vde', 'bridge', 'hubport', 'netmap', > 'vhost-user', 'vhost-vdpa' > > Outright annoying: > > $ upstream-qemu -object bad > upstream-qemu: -object bad: Parameter 'qom-type' does not accept value > 'bad' > Acceptable values are 'authz-list', 'authz-listfile', 'authz-pam', > 'authz-simple', 'can-bus', 'can-host-socketcan', 'colo-compare', > 'cryptodev-backend', 'cryptodev-backend-builtin', 'cryptodev-backend-lkcf= ', > 'dbus-vmstate', 'filter-buffer', 'filter-dump', 'filter-mirror', > 'filter-redirector', 'filter-replay', 'filter-rewriter', 'input-barrier', > 'input-linux', 'iothread', 'main-loop', 'memory-backend-epc', > 'memory-backend-file', 'memory-backend-memfd', 'memory-backend-ram', > 'pef-guest', 'pr-manager-helper', 'qtest', 'rng-builtin', 'rng-egd', > 'rng-random', 'secret', 'secret_keyring', 'sev-guest', 'thread-context', > 's390-pv-guest', 'throttle-group', 'tls-creds-anon', 'tls-creds-psk', > 'tls-creds-x509', 'tls-cipher-suites', 'x-remote-object', > 'x-vfio-user-server' > > Note we already let users ask for this information with -object help or > -object qom-type=3Dhelp. Sadly, we can't hint at that here, because it's > implemented much further up the call chain, and other call chains don't. > > If HMP command sendkey didn't bypass the input visitor, the 26 screen > lines of hint for QKeyCode would likely scroll the error message off the > screen. > > Should we suppress this hint when it's too long to be useful? > I don't have strong opinions.. perhaps stop after first 5 with "..." ? (Ideally, we would have shell completion scripts that would be able to help us, but hey that's another level! :) --00000000000052484b05f663f27c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

On Wed, Mar 8, 2023 at 5:55=E2=80= =AFPM Markus Armbruster <armbru@red= hat.com> wrote:
mar= candre.lureau@redhat.com writes:

> From: Marc-Andr=C3=A9 Lureau <marcandre.lureau@redhat.com>
>
> This allows for a more pleasant user experience.
>
> Before:
> $ ./qemu-system-x86_64 -display egl-headless,gl=3D
> qemu-system-x86_64: -display egl-headless,gl=3D: Parameter 'gl'= ; does not accept value ''
>
> After:
> $ ./qemu-system-x86_64 -display egl-headless,gl=3D
> qemu-system-x86_64: -display egl-headless,gl=3D: Parameter 'gl'= ; does not accept value ''
> Acceptable values are 'off', 'on', 'core', = 9;es'
>
> Signed-off-by: Marc-Andr=C3=A9 Lureau <marcandre.lureau@redhat.com>
Nice improvement here.

Slightly ugly:

=C2=A0 =C2=A0 $ qemu-system-x86_64 -nic bad
=C2=A0 =C2=A0 upstream-qemu: -nic bad: Parameter 'type' does not ac= cept value 'bad'
=C2=A0 =C2=A0 Acceptable values are 'none', 'nic', 'use= r', 'tap', 'l2tpv3', 'socket', 'stream'= , 'dgram', 'vde', 'bridge', 'hubport', '= ;netmap', 'vhost-user', 'vhost-vdpa'

Outright annoying:

$ upstream-qemu -object bad
upstream-qemu: -object bad: Parameter 'qom-type' does not accept va= lue 'bad'
Acceptable values are 'authz-list', 'authz-listfile', '= authz-pam', 'authz-simple', 'can-bus', 'can-host-so= cketcan', 'colo-compare', 'cryptodev-backend', 'cry= ptodev-backend-builtin', 'cryptodev-backend-lkcf', 'dbus-vm= state', 'filter-buffer', 'filter-dump', 'filter-mir= ror', 'filter-redirector', 'filter-replay', 'filter= -rewriter', 'input-barrier', 'input-linux', 'iothre= ad', 'main-loop', 'memory-backend-epc', 'memory-bac= kend-file', 'memory-backend-memfd', 'memory-backend-ram'= ;, 'pef-guest', 'pr-manager-helper', 'qtest', '= rng-builtin', 'rng-egd', 'rng-random', 'secret'= , 'secret_keyring', 'sev-guest', 'thread-context', = 's390-pv-guest', 'throttle-group', 'tls-creds-anon'= , 'tls-creds-psk', 'tls-creds-x509', 'tls-cipher-suites= ', 'x-remote-object', 'x-vfio-user-server'

Note we already let users ask for this information with -object help or
-object qom-type=3Dhelp.=C2=A0 Sadly, we can't hint at that here, becau= se it's
implemented much further up the call chain, and other call chains don't= .

If HMP command sendkey didn't bypass the input visitor, the 26 screen lines of hint for QKeyCode would likely scroll the error message off the screen.

Should we suppress this hint when it's too long to be useful?

I don't have strong opinions.. perhaps stop = after first 5 with "..." ? (Ideally, we would have shell completi= on scripts that would be able to help us, but hey that's another level!= :)
--00000000000052484b05f663f27c--