From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46870) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCShz-0004Vr-UA for qemu-devel@nongnu.org; Mon, 04 Mar 2013 05:33:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UCShy-0004qm-AP for qemu-devel@nongnu.org; Mon, 04 Mar 2013 05:33:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:65330) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UCShy-0004qh-2f for qemu-devel@nongnu.org; Mon, 04 Mar 2013 05:33:26 -0500 Date: Mon, 4 Mar 2013 10:33:20 +0000 From: "Daniel P. Berrange" Message-ID: <20130304103320.GC8123@redhat.com> References: <20130221145818.GK16618@otherpad.lan.raisama.net> <20130301131238.GE3375700@orkuz.home> <5130F412.3040903@suse.de> <20130301185818.GY8494@otherpad.lan.raisama.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20130301185818.GY8494@otherpad.lan.raisama.net> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] libvirt<->QEMU interfaces for CPU models Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eduardo Habkost Cc: libvir-list@redhat.com, Alexander Graf , qemu-devel@nongnu.org, Igor Mammedov , Jiri Denemark , Luiz Capitulino , Andreas =?utf-8?Q?F=C3=A4rber?= On Fri, Mar 01, 2013 at 03:58:18PM -0300, Eduardo Habkost wrote: > On Fri, Mar 01, 2013 at 07:31:46PM +0100, Andreas F=C3=A4rber wrote: > > Am 01.03.2013 14:12, schrieb Jiri Denemark: > > > On Thu, Feb 21, 2013 at 11:58:18 -0300, Eduardo Habkost wrote: > > >> =3D Listing CPU models =3D > > >> > > >> Requirement: libvirt needs to know which CPU models are available = to be used > > >> with the "-cpu" option. > > >> > > >> Current problem: libvirt relies on help output parsing for that. > >=20 > > query-cpu-definitions is the QMP command to retrieve values compatibl= e > > with -cpu. > >=20 > > And if libvirt is not using it, I really don't understand why the wor= k > > of maintaining this crappy interface has been pushed onto us in the > > first place? There is no reuse between -cpu ? and QMP implementations= so > > it's just extra work, there is no communicated or implemented way to > > extend the arch_query_cpu_definitions() implementation to become more > > usable for command line output implementation (e.g., associating a PV= R > > value with the model name for ppc) and, while we're at it, it uses > > global functions plus a stub rather than a CPUState hook with a no-op > > default implementation in qom/cpu.c... >=20 > I have the same questions you have. :-) >=20 > But my main complaint about query-cpu-definitions is not about the > implementation: it's that the interface was introduced without taking > into account the requirements of libvirt regarding CPU features. It was > found to be not appropriate for what libvirt needs[1], but somehow it > got applied anyway. The requirement at the time we did this was just to have a straight adaptation of the stuff libvirt parsed from -help, into QMP format. The query-cpu-definitions command served that purpose fine. It was expected that some of this may be sub-optimal in the long term. This is fine - we can either extend the existing data, or introduce brand new commands to deal with the problems. The key thing was just to get 100% into the QMP world for capabilities at that time, and then iterate to improve things. Regards, Daniel --=20 |: http://berrange.com -o- http://www.flickr.com/photos/dberrange= / :| |: http://libvirt.org -o- http://virt-manager.or= g :| |: http://autobuild.org -o- http://search.cpan.org/~danberr= / :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vn= c :|