From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55985) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzqR6-000670-5H for qemu-devel@nongnu.org; Fri, 10 Aug 2012 10:43:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SzqR3-0003Ks-Hf for qemu-devel@nongnu.org; Fri, 10 Aug 2012 10:43:36 -0400 Received: from e8.ny.us.ibm.com ([32.97.182.138]:52546) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SzqR3-0003Km-DJ for qemu-devel@nongnu.org; Fri, 10 Aug 2012 10:43:33 -0400 Received: from /spool/local by e8.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 10 Aug 2012 10:43:32 -0400 Received: from d01relay03.pok.ibm.com (d01relay03.pok.ibm.com [9.56.227.235]) by d01dlp02.pok.ibm.com (Postfix) with ESMTP id E66E86E803F for ; Fri, 10 Aug 2012 10:43:30 -0400 (EDT) Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay03.pok.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q7AEhUBb087732 for ; Fri, 10 Aug 2012 10:43:30 -0400 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q7AKEJih003417 for ; Fri, 10 Aug 2012 16:14:22 -0400 From: Anthony Liguori In-Reply-To: <20120731155743.GG18479@otherpad.lan.raisama.net> References: <1343396239-19272-1-git-send-email-aliguori@us.ibm.com> <1343396239-19272-7-git-send-email-aliguori@us.ibm.com> <20120731155743.GG18479@otherpad.lan.raisama.net> Date: Fri, 10 Aug 2012 09:43:21 -0500 Message-ID: <87fw7u6c52.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [Qemu-devel] [PATCH 6/7] target-i386: add implementation of query-cpudefs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: Peter Maydell , libvir-list@redhat.com, qemu-devel@nongnu.org, Markus Armbruster , Alexander Graf , Jiri Denemark , Eric Blake Eduardo Habkost writes: > On Fri, Jul 27, 2012 at 08:37:18AM -0500, Anthony Liguori wrote: >> Signed-off-by: Anthony Liguori >> --- >> target-i386/cpu.c | 22 ++++++++++++++++++++++ >> 1 files changed, 22 insertions(+), 0 deletions(-) >> >> diff --git a/target-i386/cpu.c b/target-i386/cpu.c >> index 6b9659f..b398439 100644 >> --- a/target-i386/cpu.c >> +++ b/target-i386/cpu.c >> @@ -28,6 +28,7 @@ >> #include "qemu-config.h" >> >> #include "qapi/qapi-visit-core.h" >> +#include "qmp-commands.h" >> >> #include "hyperv.h" >> >> @@ -1123,6 +1124,27 @@ void x86_cpu_list(FILE *f, fprintf_function cpu_fprintf, const char *optarg) >> } >> } >> >> +CpuDefInfoList *qmp_query_cpudefs(Error **errp) >> +{ >> + CpuDefInfoList *cpu_list = NULL; >> + x86_def_t *def; >> + >> + for (def = x86_defs; def; def = def->next) { >> + CpuDefInfoList *entry; >> + CpuDefInfo *info; >> + >> + info = g_malloc0(sizeof(*info)); >> + info->name = g_strdup(def->name); >> + >> + entry = g_malloc0(sizeof(*entry)); >> + entry->value = info; >> + entry->next = cpu_list; >> + cpu_list = entry; >> + } >> + >> + return cpu_list; >> +} > > How would the interface look like once we: > - let libvirt know which features are available on each CPU model > (libvirt needs that information[1]); and I'm not sure I understand why libvirt needs this information. Can you elaborate? > - add machine-type-specific cpudef compatibility changes? I think we've discussed this in IRC. I don't think we need to worry about this. > Would the command report different results depending on -machine? No. > > Would the command return the latest cpudef without any machine-type > hacks, and libvirt would have to query for the cpudef compatibility data > for each machine-type and combine both pieces of information itself? I'm not sure what you mean by compatibility data. Regards, Anthony Liguori > > [1] Note that it doesn't have to be low-level leaf-by-leaf > register-by-register CPUID bits (I prefer a more high-level > interface, myself), but it has to at least say "feature FOO is > enabled/disabled" for a set of features libvirt cares about. > > -- > Eduardo