Received: from eggs.gnu.org ([2001:4830:134:3::10]:41875) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUfwE-0005D8-Bp for qemu-devel@nongnu.org; Wed, 26 Aug 2015 15:00:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUfwB-0004WZ-Ms for qemu-devel@nongnu.org; Wed, 26 Aug 2015 15:00:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60806) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUfwB-0004W7-Ce for qemu-devel@nongnu.org; Wed, 26 Aug 2015 15:00:43 -0400 Date: Wed, 26 Aug 2015 16:00:39 -0300 From: Eduardo Habkost Message-ID: <20150826190039.GB12239@thinpad.lan.raisama.net> References: <1440407824-30037-1-git-send-email-pl@kamp.de> <55DB3C6F.3010206@redhat.com> <55DB7237.1010509@kamp.de> <20150826183806.GA12239@thinpad.lan.raisama.net> <55DE0992.70907@kamp.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55DE0992.70907@kamp.de> Subject: Re: [Qemu-devel] [PATCH] target-i386: add a list of enforceable CPU models to the help output List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Peter Lieven Cc: Michael Mueller , qemu-devel@nongnu.org, David Hildenbrand , pbonzini@redhat.com, Jiri Denemark , afaerber@suse.de, rth@twiddle.net On Wed, Aug 26, 2015 at 08:46:42PM +0200, Peter Lieven wrote: > Am 26.08.2015 um 20:38 schrieb Eduardo Habkost: > > On Mon, Aug 24, 2015 at 09:36:23PM +0200, Peter Lieven wrote: > >> Am 24.08.2015 um 17:46 schrieb Eric Blake: > >>> On 08/24/2015 03:17 AM, Peter Lieven wrote: > >>>> this patch adds a probe that lists all enforceable and migrateable > >>>> CPU models to the -cpu help output. The idea is to know a priory > >>>> which CPU modules can be exposed to the user without loosing any > >>>> feature flags. > >>>> > >>>> Signed-off-by: Peter Lieven > >>>> --- > >>>> target-i386/cpu.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ > >>>> 1 file changed, 49 insertions(+) > >>> Is this same sort of listing available through QMP? Parsing '-cpu help' > >>> output is undesirable from libvirt point of view. > >>> > >> A good point. But is there a QMP command to list available CPU types? > >> In this case it should be easy to extend. > > Yes, that's query-cpu-definitions. See past discussion at: > > http://thread.gmane.org/gmane.comp.emulators.qemu/332554 > > > > Some of the assumptions at that thread changed. See: > > http://thread.gmane.org/gmane.comp.emulators.qemu/342582/focus=346651 > > That means runnability should depend only on the accelerator type, and > > not on the machine-type anymore. > > Thanks for the pointer. But is it possible to query cpu definitions without > a running Qemu? Like passing a QMP command on the commandline and > receive the answer on stdout? Well, it's impossible to check if a CPU model is runnable without running QEMU. :) I don't think you can send a QMP command through command-line arguments, but you can easily start a QMP monitor on stdin/stdio. Example: $ (echo '{ "execute": "qmp_capabilities" }';echo '{"execute":"query-cpu-definitions"}';echo '{"execute":"quit"}';) | ./x86_64-softmmu/qemu-system-x86_64 -nodefaults -S -qmp stdio -machine none -nographic {"QMP": {"version": {"qemu": {"micro": 50, "minor": 4, "major": 2}, "package": ""}, "capabilities": []}} {"return": {}} {"return": [{"name": "Opteron_G5"}, {"name": "Opteron_G4"}, {"name": "Opteron_G3"}, {"name": "Opteron_G2"}, {"name": "Opteron_G1"}, {"name": "Broadwell"}, {"name": "Broadwell-noTSX"}, {"name": "Haswell"}, {"name": "Haswell-noTSX"}, {"name": "IvyBridge"}, {"name": "SandyBridge"}, {"name": "Westmere"}, {"name": "Nehalem"}, {"name": "Penryn"}, {"name": "Conroe"}, {"name": "n270"}, {"name": "athlon"}, {"name": "pentium3"}, {"name": "pentium2"}, {"name": "pentium"}, {"name": "486"}, {"name": "coreduo"}, {"name": "kvm32"}, {"name": "qemu32"}, {"name": "kvm64"}, {"name": "core2duo"}, {"name": "phenom"}, {"name": "qemu64"}]} {"return": {}} {"timestamp": {"seconds": 1440615228, "microseconds": 854114}, "event": "SHUTDOWN"} $ > > > > >> But, I wonder how to issue a QMP command before the vserver is actually > >> running? Is there a common way to do it? > > What's a vserver? > > > > A Virtual Server. You mean the virtual machine? Yes, it is possible to run QMP commands before the machine is running (you just need to use -S). You can also use "-machine none" if you don't want any machine-specific initialization code to run at all. -- Eduardo