From: "Andreas Färber" <afaerber@suse.de>
To: Eduardo Habkost <ehabkost@redhat.com>,
Luiz Capitulino <lcapitulino@redhat.com>,
Jiri Denemark <jdenemar@redhat.com>
Cc: libvir-list@redhat.com, Igor Mammedov <imammedo@redhat.com>,
qemu-devel@nongnu.org, Alexander Graf <agraf@suse.de>
Subject: Re: [Qemu-devel] libvirt<->QEMU interfaces for CPU models
Date: Fri, 01 Mar 2013 19:31:46 +0100 [thread overview]
Message-ID: <5130F412.3040903@suse.de> (raw)
In-Reply-To: <20130301131238.GE3375700@orkuz.home>
Am 01.03.2013 14:12, schrieb Jiri Denemark:
> On Thu, Feb 21, 2013 at 11:58:18 -0300, Eduardo Habkost wrote:
>> = Listing CPU models =
>>
>> 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.
query-cpu-definitions is the QMP command to retrieve values compatible
with -cpu.
And if libvirt is not using it, I really don't understand why the work
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 PVR
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...
>> Solution: use QMP qom-list-types command.
>>
>> Dependency: X86CPU subclasses.
>> Limitation: needs a live QEMU process for the query.
>
> No problem, we already run QEMU and use several QMP commands to probe
> its capabilities. And "qom-list-types" is actually one of them. To get
> the list of CPU models, we would just call
>
> {
> "execute": "qom-list-types",
> "arguments": {
> "implements": "X86CPU"
> }
> }
>
> right?
Not quite, this would return abstract types as well, so you'd need to
add "abstract": "false" or so.
And you need to use the type name, not the struct name as argument, i.e.
"i386-cpu" or "x86_64-cpu". Note: This does not always match the
executable name since QOM names are supposed to be verbose (e.g., ppc64
vs. powerpc64-cpu) and some executables are misnamed (sh4 vs. superh-cpu).
For x86 today this will return one type, either "i386-cpu" or
"x86_64-cpu", that's why I have been pushing to implement model
subclasses. There's still some controversial discussions about how this
relates to KVM and TCG changing values of classes.
> What about other non-x86 architectures?
For some other architectures like arm this will return the full list of
available classes, but in "cortex-a9-arm-cpu" format, which is not
guaranteed to be compatible with -cpu but rather with -device where
already applicable.
> Will we need to use
> different class name or is there a generic CPU class that could be used
> universally?
"cpu" would currently work as well, but the CPU refactorings are
targetting to compile, e.g., arm-cpu and microblaze-cpu types into the
same executable, so "cpu" may lead to undesired results in the future
depending on what assumptions your code makes.
Regards,
Andreas
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
next prev parent reply other threads:[~2013-03-01 18:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20130221145818.GK16618@otherpad.lan.raisama.net>
2013-03-01 13:12 ` [Qemu-devel] libvirt<->QEMU interfaces for CPU models Jiri Denemark
2013-03-01 15:02 ` Eduardo Habkost
2013-03-01 22:56 ` Jiri Denemark
2013-03-25 20:37 ` Eduardo Habkost
2013-03-01 18:31 ` Andreas Färber [this message]
2013-03-01 18:34 ` Daniel P. Berrange
2013-03-01 19:01 ` Eduardo Habkost
2013-03-01 18:58 ` Eduardo Habkost
2013-03-04 10:33 ` Daniel P. Berrange
2013-03-01 13:28 ` Jiri Denemark
2013-03-01 15:31 ` Eduardo Habkost
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5130F412.3040903@suse.de \
--to=afaerber@suse.de \
--cc=agraf@suse.de \
--cc=ehabkost@redhat.com \
--cc=imammedo@redhat.com \
--cc=jdenemar@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=libvir-list@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).