"Daniel P. Berrange" <berra...@redhat.com> writes: > This adds a new QMP command called 'query-cputypes' to allow > for discovery of CPU types known to the QEMU binary. This is > intended to relpace the need to parse '-cpu ?', '-cpu ?model' > and '-cpu ?dump' > > Most targets have a simple structure listing just the CPU > model names (and optionally a 'description'), with room for > future expansion of extra attributes against each model > > { > "cputypes": { > "models": [ > { > "name": "arm926" > }, > { > "name": "arm946" > }, > { > "name": "arm1026" > }, > .... > ] > } > } > > The sparc and x86 targets have extra architecture specific > metatadata. These are in keys 'x86info' and 'sparcinfo' > against each CPU model dict. These keys are repeated at the > top level to give data about all allowed feature names > > A trimmed example: > > { > "cputypes": { > "models": [ > { > "name": "n270", > "description": "Intel(R) Atom(TM) CPU N270 @ 1.60GHz", > "x86info": { > "xlevel": 2147483658, > "family": 6, > "vendor": "", > "level": 5, > "model": 28, > "stepping": 2, > "features": { > "ext_edx": [ > "lahf_lm" > ], > "edx": [ > "pbe", > "tm", > "ht", > "ss", > "sse2", > ... > ] > } > } > } > ], > "x86info": { > "features": { > "ext_edx": [ > 21, > 20, > "nodeid_msr", > "cvt16", > 17, > "fma4", > 15, > 14, > "wdt", > .... > ] > } > } > } > } > > No mapping to the legacy readline monitor is provided
An alternative to arch-specific keys with equally arch-specific values would be a arch-independent key with a discriminated union value. { "cputypes": { "models": [ { "name": "n270", "description": "Intel(R) Atom(TM) CPU N270 @ 1.60GHz", "arch-info": { "arch": "x86", "xlevel": 2147483658, "family": 6, ... Dunno.