Received: from eggs.gnu.org ([2001:4830:134:3::10]:50108) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFe1n-000893-H9 for qemu-devel@nongnu.org; Wed, 22 Jun 2016 05:00:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bFe1j-0003Yg-DU for qemu-devel@nongnu.org; Wed, 22 Jun 2016 05:00:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51528) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bFe1j-0003Yb-59 for qemu-devel@nongnu.org; Wed, 22 Jun 2016 05:00:51 -0400 From: Markus Armbruster References: <1465243543-889-1-git-send-email-ehabkost@redhat.com> <1465243543-889-5-git-send-email-ehabkost@redhat.com> Date: Wed, 22 Jun 2016 11:00:47 +0200 In-Reply-To: <1465243543-889-5-git-send-email-ehabkost@redhat.com> (Eduardo Habkost's message of "Mon, 6 Jun 2016 17:05:41 -0300") Message-ID: <87r3bplhs0.fsf@dusky.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v2 4/6] qmp: Add runnability information to query-cpu-definitions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: qemu-devel@nongnu.org, Michael Mueller , Christian Borntraeger , libvir-list@redhat.com, David Hildenbrand , Cornelia Huck , Igor Mammedov , Jiri Denemark , Andreas =?utf-8?Q?F=C3=A4rber?= Eduardo Habkost writes: > Extend query-cpu-definitions schema to allow it to return two new > optional fields: "runnable" and "unavailable-features". > "runnable" will tell if the CPU model can be run in the current > host. "unavailable-features" will contain a list of CPU > properties that are preventing the CPU model from running in the > current host. > > Cc: David Hildenbrand > Cc: Michael Mueller > Cc: Christian Borntraeger > Cc: Cornelia Huck > Cc: Jiri Denemark > Cc: libvir-list@redhat.com > Signed-off-by: Eduardo Habkost > --- > Changes v1 -> v2: > * Remove @runnable field, non-empty @unavailable-features is > enough to report CPU model as not runnable. > * Documentation updates: > * Changed to "(since 2.7)"; > * Add more details about the exact meaning of > unavailable-features, and what it would mean to see > read-only QOM properties in the list, and that > implementations can return "type" if there's > no extra information available; > --- > qapi-schema.json | 23 ++++++++++++++++++++++- > 1 file changed, 22 insertions(+), 1 deletion(-) > > diff --git a/qapi-schema.json b/qapi-schema.json > index 8483bdf..43478e9 100644 > --- a/qapi-schema.json > +++ b/qapi-schema.json > @@ -3005,11 +3005,32 @@ > # Virtual CPU definition. > # > # @name: the name of the CPU definition > +# @unavailable-features: #optional List of properties that prevent > +# the CPU model from running in the current > +# host. (since 2.7) > +# > +# @unavailable-features is a list of QOM property names that > +# represent CPU model attributes that prevent the CPU from running. > +# If the QOM property is read-only, that means there's no known > +# way to make the CPU model run in the current host. If > +# absolutely no extra information will be returned to explain why Suggest "can be returned". > +# the CPU model is not runnable, implementations may simply > +# return "type" as the property name. > +# If the property is read-write, it means that it MAY be possible > +# to run the CPU model in the current host if that property is > +# changed. Management software can use it as hints to suggest or > +# choose an alternative for the user, or just to generate meaningful > +# error messages explaining why the CPU model can't be used. > +# If @unavailable-features is an empty list, the CPU model is > +# runnable using the current host and machine-type. > +# If @unavailable-features is not present, runnability > +# information for the CPU is not available. > # > # Since: 1.2.0 > ## > { 'struct': 'CpuDefinitionInfo', > - 'data': { 'name': 'str' } } > + 'data': { 'name': 'str', > + '*unavailable-features': [ 'str' ] } } > > ## > # @query-cpu-definitions: With the commit message tidied up as per your reply to Jiri: Reviewed-by: Markus Armbruster