Received: from eggs.gnu.org ([208.118.235.92]:56477) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUiqP-0000fX-NZ for qemu-devel@nongnu.org; Tue, 23 Apr 2013 15:25:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UUiqO-0000yY-Ao for qemu-devel@nongnu.org; Tue, 23 Apr 2013 15:25:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:64800) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UUiqO-0000yO-2k for qemu-devel@nongnu.org; Tue, 23 Apr 2013 15:25:36 -0400 Date: Tue, 23 Apr 2013 16:25:33 -0300 From: Eduardo Habkost Message-ID: <20130423192533.GK2900@otherpad.lan.raisama.net> References: <1366657220-776-1-git-send-email-ehabkost@redhat.com> <1366657220-776-7-git-send-email-ehabkost@redhat.com> <51759F72.1010009@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <51759F72.1010009@redhat.com> Subject: Re: [Qemu-devel] [libvirt] [PATCH qom-cpu 6/9] target-i386: Add "feature-words" property List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: libvir-list@redhat.com, Igor Mammedov , Jiri Denemark , qemu-devel@nongnu.org, Andreas =?iso-8859-1?Q?F=E4rber?= On Mon, Apr 22, 2013 at 02:37:06PM -0600, Eric Blake wrote: > On 04/22/2013 01:00 PM, Eduardo Habkost wrote: > > This property will be useful for libvirt, as libvirt already has logic > > based on low-level feature bits (not feature names), so it will be > > really easy to convert the current libvirt logic to something using the > > "feature-words" property. > > > > The property will have two main use cases: > > - Checking host capabilities, by checking the features of the "host" > > CPU model > > - Checking which features are enabled on each CPU model > > > > Example output: > > > > $ ./QMP/qmp --path=/tmp/m qom-get --path=/machine/unattached/device[1] --property=feature-words > > If I'm not mistaken, the QMP counterpart that libvirt will use is: > > { "execute":"qom-get", > "arguments": { "path":"/machine/unattached/device[1]", > "property":"feature-words" } } Yes, but note that libvirt needs to look for the X86CPU objects, to find the actual path as there's no guarantee that it will always be /machine/unattached/devices[1]. Maybe the CPU hotplug work will end up offering a predictable path for the X86CPU objects, but this is not available yet. > > > item[0].cpuid-register: EDX > > item[0].cpuid-input-eax: 2147483658 > > item[0].features: 0 > > item[1].cpuid-register: EAX > > item[1].cpuid-input-eax: 1073741825 > > item[1].features: 0 > > item[2].cpuid-register: EDX > > item[2].cpuid-input-eax: 3221225473 > > item[2].features: 0 > > item[3].cpuid-register: ECX > > item[3].cpuid-input-eax: 2147483649 > > item[3].features: 101 > > item[4].cpuid-register: EDX > > item[4].cpuid-input-eax: 2147483649 > > item[4].features: 563346425 > > item[5].cpuid-register: EBX > > item[5].cpuid-input-eax: 7 > > item[5].features: 0 > > item[5].cpuid-input-ecx: 0 > > item[6].cpuid-register: ECX > > item[6].cpuid-input-eax: 1 > > item[6].features: 2155880449 > > item[7].cpuid-register: EDX > > item[7].cpuid-input-eax: 1 > > item[7].features: 126614521 > > And this would then be returned as a JSON array containing struct > members looking like this: > > > +{ 'type': 'X86CPUFeatureWordInfo', > > + 'data': { 'cpuid-input-eax': 'int', > > + '*cpuid-input-ecx': 'int', > > + 'cpuid-register': 'X86CPURegister32', > > + 'features': 'int' } } Yes. > > Looks reasonable (and better than what we've had in the past!), although > I'll let Jiri Denemark give final say on whether it meets libvirt's needs. Thanks for the feedback! -- Eduardo