Received: from eggs.gnu.org ([2001:4830:134:3::10]:58614) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2M65-0003Wf-V3 for qemu-devel@nongnu.org; Thu, 25 Jul 2013 10:00:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V2M63-0008KW-KQ for qemu-devel@nongnu.org; Thu, 25 Jul 2013 10:00:49 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27203) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V2M63-0008KP-DI for qemu-devel@nongnu.org; Thu, 25 Jul 2013 10:00:47 -0400 Date: Thu, 25 Jul 2013 11:00:44 -0300 From: Eduardo Habkost Message-ID: <20130725140044.GA2714@otherpad.lan.raisama.net> References: <00920fe1cd728db02fa4c81602b359986a3cf2a1.1374595782.git.jdenemar@redhat.com> <20130723163242.GQ2477@redhat.com> <20130723172838.GJ4718@orkuz.home> <20130723173246.GK4718@orkuz.home> <20130724182519.GB3573@otherpad.lan.raisama.net> <51F0EC68.1020808@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: <51F0EC68.1020808@suse.de> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [libvirt] [PATCH 4/7] qemu: Add monitor APIs to fetch CPUID data from QEMU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Andreas =?iso-8859-1?Q?F=E4rber?= Cc: libvir-list@redhat.com, Paolo Bonzini , qemu-devel@nongnu.org, Anthony Liguori On Thu, Jul 25, 2013 at 11:14:16AM +0200, Andreas F=E4rber wrote: > Am 24.07.2013 20:25, schrieb Eduardo Habkost: > > In addition to the "-cpu host" KVM initialization problem, this is an > > additional problem with the current interfaces provided by QEMU: > >=20 > > 1) libvirt needs to query data that depend on chosen machine-type and > > CPU model > > 2) Some machine-type behavior is code and not introspectable data > > * Luckily most of the data we need in this case should/will be > > encoded in the compat_props tables. > > * In either case, we don't have an API to query for machine-type > > compat_props information yet. >=20 > ... and I don't think we should add such a thing. It is an internal > implementation detail, whose results should be inspected instead. >=20 > > 3) CPU model behavior will be modelled as CPU class behavior. Like > > on the machine-type case, some of the CPU-model-specific behavior = may > > be modelled as code, and not introspectable data. > > * However, e may be able to eventually encode most or all of > > CPU-model-specific behavior simply as different per-CPU-class > > property defaults. > > * In either case, we don't have an API for QOM class introspection= , > > yet. >=20 > If I understood Anthony correctly on the previous call then that is by > design. We have a query-cpu-definitions QMP API to obtain CPU models > though. And qom-list-types to discover QOM types. The CPU can then be > instantiated via -cpu (the type via -device/-object on other targets), > inspected with qom-list/qom-get API and modified with qom-set. >=20 > The problem with the latter is that devices/CPUs get realized in code > rather than shortly before emulation/virtualization starts - that's wha= t > my recursive QOM realization series prepared to address, but Paolo > veto'ed that and hasn't provided sufficient feedback on what exactly hi= s > concerns are founded on and what he proposes instead. In particular: > Would walking the qdev bus tree instead of the QOM composition tree > address the concerns? >=20 > Depending on what libvirt is actually trying to do, the above combined > with Igor's feature properties and -S might do the job. For x86 the CPU= s > are easily locatable in the QOM tree via ICC. I still don't see how the above would solve the bigger problem: libvirt needs a way to find out how exactly "-machine foo-1.0 -cpu bar" looks different from "-machine foo-1.1 -cpu bar", but don't want to execute QEMU multiple times just to find that out. --=20 Eduardo