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 X-Spam-Level: X-Spam-Status: No, score=-10.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,HTML_MESSAGE,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3979FC4320E for ; Tue, 31 Aug 2021 13:56:04 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id AFD836102A for ; Tue, 31 Aug 2021 13:56:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AFD836102A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:36822 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mL4F8-0004qS-Oe for qemu-devel@archiver.kernel.org; Tue, 31 Aug 2021 09:56:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:57582) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL4Cw-00021P-3d for qemu-devel@nongnu.org; Tue, 31 Aug 2021 09:53:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:48336) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mL4Cs-0006uc-9w for qemu-devel@nongnu.org; Tue, 31 Aug 2021 09:53:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630418021; 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=e3A6yWP4GSf3lmqSROmJMpxAIHeRt1SNOAPM8oGQprw=; b=f7BTXv1JYyoZLjsGkE1kWyN8OPcG8VXVIu1bNeVg7+jZ8On0+SZfF69i56v257wCdphJHi MT4zpp1zlrDbBNjTj42UZGSNcXwemLp+MOsT/aLkYAiaL+1/IqWWmXMXud0h5hm7aecd8B q6NcQvnEj9CWzLGGrNdGQYEbexBcpbg= Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-438-5iG94fC5OFiwcj_OqppNxg-1; Tue, 31 Aug 2021 09:53:38 -0400 X-MC-Unique: 5iG94fC5OFiwcj_OqppNxg-1 Received: by mail-pg1-f200.google.com with SMTP id u5-20020a63d3450000b029023a5f6e6f9bso4351010pgi.21 for ; Tue, 31 Aug 2021 06:53:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=e3A6yWP4GSf3lmqSROmJMpxAIHeRt1SNOAPM8oGQprw=; b=lj+MuKyjxysY0ne6U74jH1z+eeLGI5uqow6KmS3WC5EZP+1XFMwV8/QDaCrUAExoAx E4yHTSDWkOP8npIjZ7TRmNXbRALBDgkQcVmP/vnpnT1a5Itfm2adyNJHijPmdOkBqxdW K9PBTIN9QEyAAH7v9T+fjOhfLYqf+GjidGaLVVXa+hbj4QBSD+aGuHgXObUauW0iiath qQwfb2q/B/VSmblxqy2vdE5el6OdqDfTa0wwM3e6K18KvrBvnLH7L1E9TBKXQ7QdJYkm BCScaTuuZ+h50fot9AsvDSKJVESOqwJC3rC4nwi5oVk5lZBvAOLtGpdvF4FKitqaFWO8 PyIw== X-Gm-Message-State: AOAM53216WK9ZoACjVl1viSBNAN9RZ5FBixhgjOR4e+LinL1ZOxQJppb G3Bdmfghsv+KVkxC5g8jPBHhmZCed03R/Eat+k7byTPqR9o3/wFzKV336GcBCxvj3cUHQGFRLTs qBPU5FguI5S5ZutqI8GUavs95ca//uOU= X-Received: by 2002:a63:25c5:: with SMTP id l188mr3057707pgl.281.1630418016782; Tue, 31 Aug 2021 06:53:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/h0JbA76jlf3Ez77/t2sZmFmDnZEPaRKcz1CD00sYhYcflmZemclaA7e0L+vFEGfxuYTyI9vEokIMrKcIYP0= X-Received: by 2002:a63:25c5:: with SMTP id l188mr3057692pgl.281.1630418016421; Tue, 31 Aug 2021 06:53:36 -0700 (PDT) MIME-Version: 1.0 References: <20210825092023.81396-1-thuth@redhat.com> <20210825092023.81396-4-thuth@redhat.com> In-Reply-To: <20210825092023.81396-4-thuth@redhat.com> From: Paolo Bonzini Date: Tue, 31 Aug 2021 15:53:22 +0200 Message-ID: Subject: Re: [PATCH v2 3/3] softmmu/vl: Deprecate the -sdl and -curses option To: Thomas Huth Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=pbonzini@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="000000000000b458c405cadb4626" Received-SPF: pass client-ip=170.10.133.124; envelope-from=pbonzini@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -31 X-Spam_score: -3.2 X-Spam_bar: --- X-Spam_report: (-3.2 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.391, 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_LOW=-0.7, 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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Armbruster, Markus" , qemu-devel , Gerd Hoffmann Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" --000000000000b458c405cadb4626 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable As an alternative, you may want to turn it into "-display sdl" rather than poke at dpy. This isn't much more code, but it keeps the shortcut isolated within a single "case". This follows a lot of recently cleaned up command line parsing code such as -no-hpet, -enable-kvm, -smp etc. In the end (spoiler alert for my upcoming KVM Forum presentation=E2=80=94sl= ides are already on sched.com :)) what really produces complexity is the lack of isolation/modularity. As long as UI code doesn't care about command line parsing, and command line parsing doesn't care about global variables from all over the place, the cost of shortcuts is so small that it may tilt in favor of keeping them. Paolo Il mer 25 ago 2021, 11:20 Thomas Huth ha scritto: > It's not that much complicated to type "-display sdl" or "-display curses= ", > so we should not clutter our main option name space with such simple > wrapper options and rather present the users with a concise interface > instead. Thus let's deprecate the "-sdl" and "-curses" wrapper options no= w. > > Acked-by: Peter Krempa > Signed-off-by: Thomas Huth > --- > docs/about/deprecated.rst | 10 ++++++++++ > softmmu/vl.c | 3 +++ > 2 files changed, 13 insertions(+) > > diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst > index 868eca0dd4..d5bec67a78 100644 > --- a/docs/about/deprecated.rst > +++ b/docs/about/deprecated.rst > @@ -148,6 +148,16 @@ Use ``-display sdl,grab-mod=3Dlshift-lctrl-lalt`` > instead. > > Use ``-display sdl,grab-mod=3Drctrl`` instead. > > +``-sdl`` (since 6.2) > +'''''''''''''''''''' > + > +Use ``-display sdl`` instead. > + > +``-curses`` (since 6.2) > +''''''''''''''''''''''' > + > +Use ``-display curses`` instead. > + > > QEMU Machine Protocol (QMP) commands > ------------------------------------ > diff --git a/softmmu/vl.c b/softmmu/vl.c > index 613948ab46..bb59dbf0de 100644 > --- a/softmmu/vl.c > +++ b/softmmu/vl.c > @@ -2897,6 +2897,8 @@ void qemu_init(int argc, char **argv, char **envp) > dpy.type =3D DISPLAY_TYPE_NONE; > break; > case QEMU_OPTION_curses: > + warn_report("-curses is deprecated, " > + "use -display curses instead."); > #ifdef CONFIG_CURSES > dpy.type =3D DISPLAY_TYPE_CURSES; > #else > @@ -3270,6 +3272,7 @@ void qemu_init(int argc, char **argv, char **envp) > "-display ...,window-close=3Doff instead."); > break; > case QEMU_OPTION_sdl: > + warn_report("-sdl is deprecated, use -display sdl > instead."); > #ifdef CONFIG_SDL > dpy.type =3D DISPLAY_TYPE_SDL; > break; > -- > 2.27.0 > > --000000000000b458c405cadb4626 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
As an alternative, you may want to turn it into "-di= splay sdl" rather than poke at dpy. This isn't much more code, but= it keeps the shortcut isolated within a single "case". This foll= ows a lot of recently cleaned up command line parsing code such as -no-hpet= , -enable-kvm, -smp etc.

In th= e end (spoiler alert for my upcoming KVM Forum presentation=E2=80=94slides = are already on sched.com :)) what really p= roduces complexity is the lack of isolation/modularity. As long as UI code = doesn't care about command line parsing, and command line parsing doesn= 't care about global variables from all over the place, the cost of sho= rtcuts is so small that it may tilt in favor of keeping them.

Paolo

Il mer 25 ago 2021, 11:20 = Thomas Huth <thuth@redhat.com>= ; ha scritto:
It's not that muc= h complicated to type "-display sdl" or "-display curses&quo= t;,
so we should not clutter our main option name space with such simple
wrapper options and rather present the users with a concise interface
instead. Thus let's deprecate the "-sdl" and "-curses&qu= ot; wrapper options now.

Acked-by: Peter Krempa <pkrempa@redhat.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
---
=C2=A0docs/about/deprecated.rst | 10 ++++++++++
=C2=A0softmmu/vl.c=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 |=C2=A0 = 3 +++
=C2=A02 files changed, 13 insertions(+)

diff --git a/docs/about/deprecated.rst b/docs/about/deprecated.rst
index 868eca0dd4..d5bec67a78 100644
--- a/docs/about/deprecated.rst
+++ b/docs/about/deprecated.rst
@@ -148,6 +148,16 @@ Use ``-display sdl,grab-mod=3Dlshift-lctrl-lalt`` inst= ead.

=C2=A0Use ``-display sdl,grab-mod=3Drctrl`` instead.

+``-sdl`` (since 6.2)
+'''''''''''''''= ;'''''
+
+Use ``-display sdl`` instead.
+
+``-curses`` (since 6.2)
+'''''''''''''''= ;''''''''
+
+Use ``-display curses`` instead.
+

=C2=A0QEMU Machine Protocol (QMP) commands
=C2=A0------------------------------------
diff --git a/softmmu/vl.c b/softmmu/vl.c
index 613948ab46..bb59dbf0de 100644
--- a/softmmu/vl.c
+++ b/softmmu/vl.c
@@ -2897,6 +2897,8 @@ void qemu_init(int argc, char **argv, char **envp) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0dpy.type =3D = DISPLAY_TYPE_NONE;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0break;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case QEMU_OPTION_curses: +=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 warn_report("= -curses is deprecated, "
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 "use -display curses instead.");
=C2=A0#ifdef CONFIG_CURSES
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0dpy.type =3D = DISPLAY_TYPE_CURSES;
=C2=A0#else
@@ -3270,6 +3272,7 @@ void qemu_init(int argc, char **argv, char **envp) =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"-display ...,window-close=3Doff instea= d.");
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0break;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0case QEMU_OPTION_sdl:
+=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 warn_report("= -sdl is deprecated, use -display sdl instead.");
=C2=A0#ifdef CONFIG_SDL
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0dpy.type =3D = DISPLAY_TYPE_SDL;
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0break;
--
2.27.0

--000000000000b458c405cadb4626--