From: Eric Blake <eblake@redhat.com>
To: Eduardo Habkost <ehabkost@redhat.com>
Cc: libvir-list@redhat.com, "Igor Mammedov" <imammedo@redhat.com>,
"Jiri Denemark" <jdenemar@redhat.com>,
qemu-devel@nongnu.org, "Andreas Färber" <afaerber@suse.de>
Subject: Re: [Qemu-devel] [PATCH qom-cpu 6/9] target-i386: Add "feature-words" property
Date: Fri, 03 May 2013 08:25:47 -0600 [thread overview]
Message-ID: <5183C8EB.8030200@redhat.com> (raw)
In-Reply-To: <20130503131707.GW28606@otherpad.lan.raisama.net>
[-- Attachment #1: Type: text/plain, Size: 1957 bytes --]
On 05/03/2013 07:17 AM, Eduardo Habkost wrote:
>
> We could, but maybe it would make the interface harder to use and not
> easier?
>
> Even when two feature words are returned in the same CPUID leaf, they
> are independent and separate feature-words that must be checked
> individually by libvirt, so I believe returning one feature-word per
> array-item makes more sense. Having an extra item in the array would
> make it clear for libvirt that QEMU has a new feature-word that libvirt
> doesn't know about, and easier to spot than an extra field in an
> existing array item.
Firmly agree - bundling multiple features into one array item is not nice.
>
>
>> item[5].CPUID: EAX=7h,ECX=0h
>
> What would be the data type of this "CPUID" field? Are you suggesting
> returning a string to be parsed manually?
Anything that requires parsing to break into pieces on the receiving end
implies that it was not correctly represented in JSON in the first
place. I'd much rather see it kept as multiple fields.
>>> + for (w = 0; w < FEATURE_WORDS; w++) {
>>> + FeatureWordInfo *wi = &feature_word_info[w];
>>> + X86CPUFeatureWordInfo *qwi = &word_infos[w];
>>> + qwi->cpuid_input_eax = wi->cpuid_eax;
>>> + qwi->has_cpuid_input_ecx = wi->cpuid_needs_ecx;
>>> + qwi->cpuid_input_ecx = wi->cpuid_ecx;
>>> + qwi->cpuid_register = x86_reg_info_32[wi->cpuid_reg].qapi_enum;
>> Is there way not to use qapi_enum at all and use name instead?
>
> Are you suggesting making the qapi interface be string-based instead of
> using an enum? Why?
enum-based is better than string based. That way, when we add
introspection in qemu 1.6, libvirt can see what enum values to expect,
instead of having an open-ended set of strings with no idea what strings
will be present.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 621 bytes --]
next prev parent reply other threads:[~2013-05-03 14:25 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-22 19:00 [Qemu-devel] [PATCH qom-cpu 0/9] x86: feature words array (v11) + "feature-words" property Eduardo Habkost
2013-04-22 19:00 ` [Qemu-devel] [PATCH qom-cpu 1/9] target-i386: cleanup: Group together level, xlevel, xlevel2 fields Eduardo Habkost
2013-04-22 19:00 ` [Qemu-devel] [PATCH qom-cpu 2/9] target-i386/kvm.c: Code formatting changes Eduardo Habkost
2013-05-01 22:55 ` Andreas Färber
2013-04-22 19:00 ` [Qemu-devel] [PATCH qom-cpu 3/9] target-i386/cpu.c: Break lines so they don't get too long Eduardo Habkost
2013-04-22 19:00 ` [Qemu-devel] [PATCH qom-cpu 4/9] target-i386: Replace cpuid_*features fields with a feature word array Eduardo Habkost
2013-05-01 23:03 ` Andreas Färber
2013-05-02 15:06 ` Eduardo Habkost
2013-04-22 19:00 ` [Qemu-devel] [PATCH qom-cpu 5/9] target-i386: Add ECX information to FeatureWordInfo Eduardo Habkost
2013-05-03 15:16 ` Andreas Färber
2013-05-03 15:54 ` Eduardo Habkost
2013-05-06 16:27 ` Andreas Färber
2013-04-22 19:00 ` [Qemu-devel] [PATCH qom-cpu 6/9] target-i386: Add "feature-words" property Eduardo Habkost
2013-04-22 20:37 ` [Qemu-devel] [libvirt] " Eric Blake
2013-04-23 19:25 ` Eduardo Habkost
2013-05-03 11:34 ` [Qemu-devel] " Igor Mammedov
2013-05-03 13:17 ` Eduardo Habkost
2013-05-03 14:25 ` Eric Blake [this message]
2013-05-03 14:57 ` Eric Blake
2013-04-22 19:00 ` [Qemu-devel] [PATCH qom-cpu 7/9] target-i386: Use FeatureWord loop on filter_features_for_kvm() Eduardo Habkost
2013-05-03 15:01 ` Eric Blake
2013-05-06 16:28 ` Andreas Färber
2013-04-22 19:00 ` [Qemu-devel] [PATCH qom-cpu 8/9] target-i386: Introduce X86CPU.filtered_features field Eduardo Habkost
2013-05-03 15:03 ` Eric Blake
2013-04-22 19:00 ` [Qemu-devel] [PATCH qom-cpu 9/9] target-i386: Add "filtered-features" property to X86CPU Eduardo Habkost
2013-05-03 15:10 ` Eric Blake
2013-05-01 22:53 ` [Qemu-devel] [PATCH qom-cpu 0/9] x86: feature words array (v11) + "feature-words" property Andreas Färber
2013-05-02 19:43 ` Eduardo Habkost
2013-05-02 19:48 ` Eric Blake
2013-05-03 14:58 ` Andreas Färber
2013-05-03 15:23 ` Igor Mammedov
2013-05-03 15:31 ` Eric Blake
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=5183C8EB.8030200@redhat.com \
--to=eblake@redhat.com \
--cc=afaerber@suse.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).