Received: from eggs.gnu.org ([2001:4830:134:3::10]:55563) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c5B2B-0002wc-LN for qemu-devel@nongnu.org; Fri, 11 Nov 2016 07:34:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c5B28-0008Uz-HU for qemu-devel@nongnu.org; Fri, 11 Nov 2016 07:34:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45152) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c5B28-0008UW-CE for qemu-devel@nongnu.org; Fri, 11 Nov 2016 07:34:16 -0500 Date: Fri, 11 Nov 2016 10:34:12 -0200 From: Eduardo Habkost Message-ID: <20161111123412.GX5057@thinpad.lan.raisama.net> References: <20161031150723.65138525@nial.brq.redhat.com> <20161031143605.GT5057@thinpad.lan.raisama.net> <878tsz5jw2.fsf@dusky.pond.sub.org> <20161104160421.GJ5057@thinpad.lan.raisama.net> <874m3j1zjd.fsf@dusky.pond.sub.org> <20161107123858.GO5057@thinpad.lan.raisama.net> <878tsvs686.fsf@dusky.pond.sub.org> <20161107171111.GR5057@thinpad.lan.raisama.net> <87a8damntm.fsf@dusky.pond.sub.org> <20161111121744.GA5348@orkuz.home> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161111121744.GA5348@orkuz.home> Subject: Re: [Qemu-devel] [PATCH v4 7/8] qmp: Support abstract classes on device-list-properties List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , libvir-list@redhat.com, Igor Mammedov , qemu-devel@nongnu.org, Andreas =?iso-8859-1?Q?F=E4rber?= On Fri, Nov 11, 2016 at 01:17:44PM +0100, Jiri Denemark wrote: > On Tue, Nov 08, 2016 at 08:29:41 +0100, Markus Armbruster wrote: > > Eduardo Habkost writes: > > > libvirt wants to know if the QEMU binary supports a given -cpu > > > option (normally CPU features that can be enabled/disabled using > > > "+foo"/"-foo"). > > > > The obvious way to check whether a specific CPU supports it is to > > introspect that CPU. > > > > The obvious way to check whether all CPUs of interest support it > > (assuming that is a productive question) is to introspect all CPUs of > > interest. Works regardless of whether the option is inherited, which is > > really an implementation detail. > > As Eduardo said, libvirt wants to know whether it can use a given CPU > feature with current QEMU binary. In -cpu help, we can see a list of > models and features QEMU understands, but we need to get similar info > via QMP. CPU models are easy, but how do we get the list of CPU > features? If introspection is the way to get it, I'm fine with that, > just beware that we don't actually know the name of the CPU object > (Westmere-x86_64-cpu), we only know the name of the CPU model > (Westmere). So if the object name is needed, we need to query the > mapping from CPU model names to CPU object names. I have patches to add the QOM type name to query-cpu-definitions. I don't remember if I submitted them to qemu-devel already. I will check. -- Eduardo