cpu-gather: Move full model extraction to new script

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Tim Wiederhake 2020-12-15 17:24:58 +01:00 committed by Michal Privoznik
parent 92a989b9d4
commit b1773967c5
2 changed files with 15 additions and 21 deletions

View File

@ -117,7 +117,21 @@ def gather_static_model(args):
def gather_full_model(args, static_model):
if static_model:
return []
return call_qemu(args.path_to_qemu, [
{
"execute": "query-cpu-model-expansion",
"arguments":
{
"type": "full",
"model": static_model
},
"id": "model-expansion"
},
{
"execute": "query-cpu-definitions",
"id": "definitions"
}
])
else:
return call_qemu(args.path_to_qemu, [
{

View File

@ -4,23 +4,3 @@ if [ -z "${CPU_GATHER_PY}" ]; then
echo >&2 "Do not call this script directly. Use 'cpu-gather.py' instead."
exit 1
fi
model_expansion()
{
mode=$1
model=$2
echo '{"execute":"query-cpu-model-expansion","arguments":' \
'{"type":"'"$mode"'","model":'"$model"'},"id":"model-expansion"}'
}
$qemu -machine accel=kvm -cpu host -nodefaults -nographic -qmp stdio <<EOF
{"execute":"qmp_capabilities"}
$(
if [ "x$model" != x ]; then
model_expansion full "$model"
fi
)
{"execute":"query-cpu-definitions","id":"definitions"}
{"execute":"quit"}
EOF