From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH] target-i386: Improve x86_cpu_list output Date: Wed, 27 Feb 2013 08:52:50 +0100 Message-ID: <512DBB52.8040006@web.de> References: <5128E3FC.8010206@web.de> <20130226225756.09a78aeb@thinkpad.mammed.net> <20130227032638.GJ8494@otherpad.lan.raisama.net> <20130227083721.720ee6a3@thinkpad.mammed.net> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2XUPWCBDBIGAMFLUBETOX" Cc: Eduardo Habkost , Anthony Liguori , qemu-devel , =?ISO-8859-1?Q?Andreas_F=E4rber?= , kvm To: Igor Mammedov Return-path: Received: from mout.web.de ([212.227.17.12]:51916 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753507Ab3B0HxG (ORCPT ); Wed, 27 Feb 2013 02:53:06 -0500 In-Reply-To: <20130227083721.720ee6a3@thinkpad.mammed.net> Sender: kvm-owner@vger.kernel.org List-ID: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2XUPWCBDBIGAMFLUBETOX Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2013-02-27 08:37, Igor Mammedov wrote: > On Wed, 27 Feb 2013 00:26:38 -0300 > Eduardo Habkost wrote: >=20 >> On Tue, Feb 26, 2013 at 10:57:56PM +0100, Igor Mammedov wrote: >>> On Sat, 23 Feb 2013 16:45:00 +0100 >>> Jan Kiszka wrote: >>> >>>> From: Jan Kiszka >>>> >>>> Several issues fixed: >>>> - We were missing a bunch of feature lists. Fix this by simply dump= ing >>>> the meta list feature_word_info. >>>> - kvm_enabled() cannot be true at this point because accelerators a= re >>>> initialized much later during init. Simply dump unconditionally. >>> Why not to move list_cpu after accelerators are initialized? >> >> Because help output is simply documentation and shouldn't depend on an= y >> other config option parsing or accelerator initialization at all? > Don't see reason why it shouldn't. > It's not a man page but a program and can do pretty much everything. Actually, requiring "-enable-kvm -cpu ?" to list the host type would be counterproductive - hardly any user will find this out, at best by chance. However ... >=20 >> >>> >>>> - Add explanation for "host" CPU type. >>>> >>>> Signed-off-by: Jan Kiszka >>>> --- >>>> target-i386/cpu.c | 20 +++++++++----------- >>>> 1 files changed, 9 insertions(+), 11 deletions(-) >>>> >>>> diff --git a/target-i386/cpu.c b/target-i386/cpu.c >>>> index dfcf86e..6e742f0 100644 >>>> --- a/target-i386/cpu.c >>>> +++ b/target-i386/cpu.c >>>> @@ -1453,18 +1453,16 @@ void x86_cpu_list(FILE *f, fprintf_function = cpu_fprintf) >>>> snprintf(buf, sizeof(buf), "%s", def->name); >>>> (*cpu_fprintf)(f, "x86 %16s %-48s\n", buf, def->model_id);= >>>> } >>>> - if (kvm_enabled()) { >>>> - (*cpu_fprintf)(f, "x86 %16s\n", "[host]"); >>>> - } >>>> + (*cpu_fprintf)(f, "x86 %16s %-48s\n", "host", >>>> + "KVM processor with all supported host features"= ); >>>> + >>> that would make 'host' visible to users even if QEMU compiled without= KVM >>> support. No big harm, but autotest could get confused when it gets 'h= ost' CPU >>> but QEMU doesn't run because it's not really supported. >> >> Then we have to fix the autotest test code to not try it without KVM. >> :-) >> >> Help output is not a probing mechanism (although we often misuse it as= >> if it were), and I expect help output to be static and not depend on a= ny >> subsystem initialization. > Then fix help output and add to "host" line something like " is availab= le with > -enable-kvm on command line and if your build was compiled --enable-kvm= > configure option", otherwise 'host' is misleading. > Now even without 'host' in output of -cpu 'help', question why 'host' i= s not > found periodically pops up on IRC. This change will just increase frequ= ency of > it. =2E..I will add "(only available in KVM mode)" here and wrap these lines in #ifdef CONFIG_KVM. That should be more acceptable, no? Jan ------enig2XUPWCBDBIGAMFLUBETOX Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iEYEARECAAYFAlEtu1kACgkQitSsb3rl5xSZKACff3QyBJzZDk4BQXXXN81c1AXO 2L0An2nzDkhQZ9ZFVnROPY/lYfiEcrvm =9QEj -----END PGP SIGNATURE----- ------enig2XUPWCBDBIGAMFLUBETOX--