From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:49633) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYGvr-00029t-CP for qemu-devel@nongnu.org; Fri, 03 May 2013 10:25:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UYGvl-0001Ee-Up for qemu-devel@nongnu.org; Fri, 03 May 2013 10:25:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:10618) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UYGvl-0001EZ-LA for qemu-devel@nongnu.org; Fri, 03 May 2013 10:25:49 -0400 Message-ID: <5183C8EB.8030200@redhat.com> Date: Fri, 03 May 2013 08:25:47 -0600 From: Eric Blake MIME-Version: 1.0 References: <1366657220-776-1-git-send-email-ehabkost@redhat.com> <1366657220-776-7-git-send-email-ehabkost@redhat.com> <20130503133423.21b8a67c@thinkpad> <20130503131707.GW28606@otherpad.lan.raisama.net> In-Reply-To: <20130503131707.GW28606@otherpad.lan.raisama.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="----enig2QBFDFHHSBLVXADSPDUVF" Subject: Re: [Qemu-devel] [PATCH qom-cpu 6/9] target-i386: Add "feature-words" property List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: libvir-list@redhat.com, Igor Mammedov , Jiri Denemark , qemu-devel@nongnu.org, =?UTF-8?B?QW5kcmVhcyBGw6RyYmVy?= This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2QBFDFHHSBLVXADSPDUVF Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 05/03/2013 07:17 AM, Eduardo Habkost wrote: >=20 > We could, but maybe it would make the interface harder to use and not > easier? >=20 > 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= =2E >=20 >=20 >> item[5].CPUID: EAX=3D7h,ECX=3D0h >=20 > 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 =3D 0; w < FEATURE_WORDS; w++) { >>> + FeatureWordInfo *wi =3D &feature_word_info[w]; >>> + X86CPUFeatureWordInfo *qwi =3D &word_infos[w]; >>> + qwi->cpuid_input_eax =3D wi->cpuid_eax; >>> + qwi->has_cpuid_input_ecx =3D wi->cpuid_needs_ecx; >>> + qwi->cpuid_input_ecx =3D wi->cpuid_ecx; >>> + qwi->cpuid_register =3D x86_reg_info_32[wi->cpuid_reg].qapi_= enum; >> Is there way not to use qapi_enum at all and use name instead? >=20 > 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. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org ------enig2QBFDFHHSBLVXADSPDUVF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.13 (GNU/Linux) Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJRg8jrAAoJEKeha0olJ0NqgP4H/i9LUnat5PiTCdPmEnZ0KYDS Y/fzaw8rl58+ZCXdhUz9L4uCrdNBuTkeb8sJwYnrF/Od99NpXa/giRrb2XmOsyzZ zEGA9felZUwypOMprCnUqc5lCp6Qhh2i4oSJXvuo7QbcDBbbSrc4127RvvlB/D62 CKFV+BbWjkLOwVYsH9Hgy6XW6FH7mZCFDn20o/qIAd9gpldzzUJttewPo19nyCVD RBWLysLk3nseTr5hfFWFEQkXOw91k2m2PmjT+u4NBTzSZ5+CbVhw5FzPaqqeaXhJ FK9jPvhIhawkrTziqCWWENzmrI7B1Mibk/aMFUliSXqNacucZnUDFIb0fyZBdWs= =obtE -----END PGP SIGNATURE----- ------enig2QBFDFHHSBLVXADSPDUVF--