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=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_MUTT 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 216D8C282CE for ; Wed, 22 May 2019 17:47:17 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 00C8C21019 for ; Wed, 22 May 2019 17:47:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 00C8C21019 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([127.0.0.1]:48893 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTVKe-0004WI-6C for qemu-devel@archiver.kernel.org; Wed, 22 May 2019 13:47:16 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50679) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hTVJp-00043F-Q4 for qemu-devel@nongnu.org; Wed, 22 May 2019 13:46:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hTVJo-0002ZB-Ke for qemu-devel@nongnu.org; Wed, 22 May 2019 13:46:25 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53664) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hTVJo-0002YE-Bp for qemu-devel@nongnu.org; Wed, 22 May 2019 13:46:24 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5E3A27CB95; Wed, 22 May 2019 17:46:14 +0000 (UTC) Received: from localhost (ovpn-116-14.gru2.redhat.com [10.97.116.14]) by smtp.corp.redhat.com (Postfix) with ESMTP id CAEE562660; Wed, 22 May 2019 17:46:12 +0000 (UTC) Date: Wed, 22 May 2019 14:46:11 -0300 From: Eduardo Habkost To: Jiri Denemark Message-ID: <20190522174611.GT10764@habkost.net> References: <20190422234742.15780-1-ehabkost@redhat.com> <20190509133537.GK7181@orkuz.int.mamuti.net> <20190509135617.GH4189@habkost.net> <20190509152616.GL7181@orkuz.int.mamuti.net> <20190509160825.GL4189@habkost.net> <20190510113303.GQ7181@orkuz.int.mamuti.net> <20190510202313.GV4189@habkost.net> <20190522084256.GJ2545064@orkuz.int.mamuti.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190522084256.GJ2545064@orkuz.int.mamuti.net> User-Agent: Mutt/1.10.1 (2018-07-13) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Wed, 22 May 2019 17:46:19 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: Re: [Qemu-devel] [PATCH 0/2] i386: "unavailable-features" QOM property X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Paolo Bonzini , Richard Henderson , qemu-devel@nongnu.org, Igor Mammedov Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Wed, May 22, 2019 at 10:42:56AM +0200, Jiri Denemark wrote: > On Fri, May 10, 2019 at 17:23:13 -0300, Eduardo Habkost wrote: > > On Fri, May 10, 2019 at 01:33:03PM +0200, Jiri Denemark wrote: > > > On Thu, May 09, 2019 at 13:08:25 -0300, Eduardo Habkost wrote: > > > > On Thu, May 09, 2019 at 05:26:16PM +0200, Jiri Denemark wrote: > > > > > On Thu, May 09, 2019 at 10:56:17 -0300, Eduardo Habkost wrote: > > > > > > On Thu, May 09, 2019 at 03:35:37PM +0200, Jiri Denemark wrote: > > > > > > > Would this unavailable-features property contain only canonical names of > > > > > > > the features or all possible aliases of all features? For example, > > > > > > > "tsc-adjust" can also be spelled as "tsc_adjust". When calling > > > > > > > query-cpu-model-expansion, we have a way to request all variants by > > > > > > > running full expansion on the result of a previous static expansion. Can > > > > > > > we get something like this for unavailable-features too? > > > > > > > > > > > > I'd like to avoid that, and refer only to the canonical names. > > > > > > > > > > > > Could you explain the use case you have in mind, so we can look > > > > > > for alternatives? > > > > > > > > > > Libvirt only knows about a single spelling for each CPU feature and > > > > > quite often it is not the canonical variant. Thus libvirt would only > > > > > recognize features for which the name known by libvirt is the canonical > > > > > name. > > > > > > > > > > We could theoretically make the translation in libvirt, but it's not > > > > > going to be future proof. If a new spelling is introduced, it's because > > > > > the old one is not considered correct and the new one becomes the > > > > > canonical version. When libvirt doesn't have the translation (libvirt is > > > > > older or just didn't catch up yet) we have a big problem. > > > > > > > > > > I guess a good alternative would be some way of querying all CPU feature > > > > > names and their aliases. If I'm not mistaken, we can either get a list > > > > > of canonical names or all names, but without any clue which names > > > > > actually refer to a single feature. > > > > > > > > Right. But (as described below) if you want to know the status a > > > > specific feature you already know about (even if you are using > > > > the old spelling), qom-get should work for you. > > > > > > Yeah, since we'll be checking all features anyway, we can detect enabled > > > and disabled features at the same time. However, we don't know whether a > > > specific feature was disabled because we did not ask for it to be > > > enabled (remember, CPU model definition may differ between libvirt and > > > QEMU) or because it was filtered out. > > > > > > Depending on the domain XML used to start a domain, libvirt may not (and > > > usually will not) refuse to start a domain for which QEMU filtered out > > > some CPU features. Of course, once the domain is running, the checking > > > becomes very strict and libvirt would refuse to start the domain on > > > another host during migration if any feature is filtered out. > > > > > > Thus libvirt stores all features QEMU filtered out when a domain was > > > started in the non-strict way. So we need to match the features in the > > > unavailable-features list with our features. Just checking for the list > > > being empty is not sufficient. > > > > OK, I understand you want to translate the canonical names on > > unavailable-features back to the old names on some cases. > > > > But I really prefer Igor's suggestion of deprecating aliases and > > getting rid of them in the future, instead of increasing the > > complexity of our QMP interfaces just to accommodate the existing > > aliases. > > OK, I think you can go on and implement the unavailable-features > property the way you suggested and we'll deal with the translation > internally in libvirt. OK, I'm queueing this series on x86-next. Thanks for the feedback! -- Eduardo