All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: "David Hildenbrand" <dahi@linux.vnet.ibm.com>,
	libvir-list@redhat.com, qemu-devel@nongnu.org,
	"Christian Borntraeger" <borntraeger@de.ibm.com>,
	"Cornelia Huck" <cornelia.huck@de.ibm.com>,
	"Igor Mammedov" <imammedo@redhat.com>,
	"Jiri Denemark" <jdenemar@redhat.com>,
	"Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [libvirt] [PATCH 7/9] qmp: Add runnability information to query-cpu-definitions
Date: Mon, 30 May 2016 11:33:38 +0200	[thread overview]
Message-ID: <87mvn7evpp.fsf@dusky.pond.sub.org> (raw)
In-Reply-To: <20160527201955.GK23701@thinpad.lan.raisama.net> (Eduardo Habkost's message of "Fri, 27 May 2016 17:19:55 -0300")

Eduardo Habkost <ehabkost@redhat.com> writes:

> Just noticed that I hadn't replied to this yet. Sorry for the
> long delay!
>
> On Thu, May 12, 2016 at 09:46:25AM +0200, Markus Armbruster wrote:
>> Eduardo Habkost <ehabkost@redhat.com> writes:
> [...]
>> > ##
>> > # @CpuDefinitionInfo:
>> > #
>> > # Virtual CPU definition.
>> > #
>> > # @name: the name of the CPU definition
>> > # @runnable: #optional. whether the CPU model us usable with the
>> > #            current machine and accelerator. Omitted if we don't
>> > #            know the answer. (since 2.7)
>> > # @unavailable-features: List of attributes that prevent the CPU
>> 
>> Unless you drop the * sigil from '*unavailable-features', you need to
>> insert #optional after the colon.
>
> Fixed.
>
>> 
>> > #                        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 the CPU model can
>> > # never run in the current host. 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.
>> > #
>> > # Since: 1.2.0
>> > ##
>> 
>> Better.
>> 
>> Next issue: how @runnable and @unavailable-features are related isn't
>> fully documented.  Here's my guess:
>> 
>> Combinations possible?            @runnable
>> @unavailable-features       absent  false  true
>> absent                         yes      ?     ?
>> present, empty                   ?      ?     ?
>> present, non-empty               ?    yes    no
>
> unavailable-features should be present only if runnable is false.
> It may be absent or empty if the architecture code still doesn't
> provide detailed info.
>
> Once we have additional architectures implementing the new
> fields, we can consider requiring unavailable-features to be
> always present (and non-empty) if runnable is false.
>
> In other words:
>
> Combinations possible?            @runnable
> @unavailable-features       absent  false  true
> absent                         yes  yes[1]  yes
> present, empty                  no  yes[1]   no
> present, non-empty              no   yes     no
>
> [1] I would like it to be "no", but I prefer to make it mandatory
>     only after we get some experience with other architectures.
>
>
> I'm making the following changes to the documentation:
>
>  # Virtual CPU definition.
>  #
>  # @name: the name of the CPU definition
> -# @runnable: #optional. whether the CPU model us usable with the
> +# @runnable: #optional Whether the CPU model us usable with the
>  #            current machine and accelerator. Omitted if we don't
>  #            know the answer. (since 2.7)
> -# @unavailable-features: List of attributes that prevent the CPU
> -#                        model from running in the current host.
> +# @unavailable-features: #optional List of attributes that prevent
> +#                        the CPU model from running in the current
> +#                        host. Present only if @runnable is false.
>  #                        (since 2.7)
>  #
>  # @unavailable-features is a list of QOM property names that

"Present only if @runnable is false" makes me wonder why we need two
separate optional members tied together with constraints.  I dislike
such constraints, and avoid them whenever practical.

The new members encode an answer to the question whether a certain CPU
usable with the current machine an accelerator, and if no, why.
The possible answers are:

(1) Don't know.
(2) Yes.
(3) No, but we can't say why.
(4) No, and here's a list of reasons.

The two "dunno" answers (1) and (3) exist so we don't have to boil the
CPU ocean now.

Without them, the natural solution is a single member, where (4) is
encoded as nonempty list, and (2) could be encoded as empty list or
absent.

Now let me try to fit in (1) and (3).

The obvious way to do (1) is absent.  So let's use empty list for (2).

That leaves (3).  I think the simplest solution that could possibly work
is to treat it as a special "dunno" reason: encode it just like (4), but
with a special "dunno" list element.  I'd use the empty string.

Could even be used if we need to distinguish

(4a) No, and here's the *complete* list of reasons.
(4b) No, and here's a possibly incomplete list of reasons.

For (4b), include the "dunno" element with the others.

Unlike the proposed solution, this one doesn't leave interface crud
behind if we succeed in getting rid of (1) and (3):

* When (1) goes away, the single member becomes mandatory.

* When (3) goes away, the special "dunno" list element no longer occurs.

  reply	other threads:[~2016-05-30  9:33 UTC|newest]

Thread overview: 47+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-06 18:11 [Qemu-devel] [PATCH 0/9] Add runnability info to query-cpu-definitions Eduardo Habkost
2016-05-06 18:11 ` [Qemu-devel] [PATCH 1/9] target-i386: Move TCG initialization check to tcg_x86_init() Eduardo Habkost
2016-05-10 14:58   ` Igor Mammedov
2016-05-06 18:11 ` [Qemu-devel] [PATCH 2/9] target-i386: Move TCG initialization to realize time Eduardo Habkost
2016-05-10 15:10   ` Igor Mammedov
2016-05-06 18:11 ` [Qemu-devel] [PATCH 3/9] target-i386: Call cpu_exec_init() on realize Eduardo Habkost
2016-05-10 15:15   ` Igor Mammedov
2016-05-06 18:11 ` [Qemu-devel] [PATCH 4/9] target-i386: List CPU models using subclass list Eduardo Habkost
2016-05-06 18:11 ` [Qemu-devel] [PATCH 5/9] target-i386: Move warning code outside x86_cpu_filter_features() Eduardo Habkost
2016-05-06 18:11 ` [Qemu-devel] [PATCH 6/9] target-i386: Define CPUID filtering functions before x86_cpu_list() Eduardo Habkost
2016-05-06 18:11 ` [Qemu-devel] [PATCH 7/9] qmp: Add runnability information to query-cpu-definitions Eduardo Habkost
2016-05-09  6:04   ` Markus Armbruster
2016-05-09  8:54   ` David Hildenbrand
2016-05-09 12:00     ` Eduardo Habkost
2016-05-09 12:05       ` David Hildenbrand
2016-05-09 12:36         ` Eduardo Habkost
2016-05-09 13:06           ` David Hildenbrand
2016-05-09 19:45             ` Eduardo Habkost
2016-05-10  6:32               ` David Hildenbrand
2016-05-10 12:03                 ` Eduardo Habkost
2016-05-09 15:20   ` [Qemu-devel] [libvirt] " Eric Blake
2016-05-09 19:25     ` Eduardo Habkost
2016-05-10  8:23       ` Markus Armbruster
2016-05-10  8:31         ` Jiri Denemark
2016-05-10 11:57         ` Eduardo Habkost
2016-05-11  7:11           ` Markus Armbruster
2016-05-11 19:35             ` Eduardo Habkost
2016-05-12  6:46               ` David Hildenbrand
2016-05-12  7:19               ` Jiri Denemark
2016-05-12 11:07                 ` Eduardo Habkost
2016-05-12  7:46               ` Markus Armbruster
2016-05-27 20:19                 ` Eduardo Habkost
2016-05-30  9:33                   ` Markus Armbruster [this message]
2016-05-31 12:01                     ` Eduardo Habkost
2016-05-31 13:24                       ` Markus Armbruster
2016-05-31 14:51                         ` Eduardo Habkost
2016-06-03 11:38                           ` David Hildenbrand
2016-05-06 18:11 ` [Qemu-devel] [PATCH 8/9] target-i386: Use "-" instead of "_" on all feature names Eduardo Habkost
2016-05-10 15:19   ` Igor Mammedov
2016-05-10 17:36     ` Jiri Denemark
2016-05-24 12:17   ` Igor Mammedov
2016-05-24 12:34     ` Eduardo Habkost
2016-05-24 13:22       ` Igor Mammedov
2016-05-27 20:32         ` Eduardo Habkost
2016-05-30  8:43           ` Igor Mammedov
2016-05-06 18:11 ` [Qemu-devel] [PATCH 9/9] target-i386: Return runnability information on query-cpu-definitions Eduardo Habkost
2016-05-09  7:24 ` [Qemu-devel] [PATCH 0/9] Add runnability info to query-cpu-definitions David Hildenbrand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mvn7evpp.fsf@dusky.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=afaerber@suse.de \
    --cc=borntraeger@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=dahi@linux.vnet.ibm.com \
    --cc=ehabkost@redhat.com \
    --cc=imammedo@redhat.com \
    --cc=jdenemar@redhat.com \
    --cc=libvir-list@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.