mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
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:
parent
92a989b9d4
commit
b1773967c5
@ -117,7 +117,21 @@ def gather_static_model(args):
|
|||||||
|
|
||||||
def gather_full_model(args, static_model):
|
def gather_full_model(args, static_model):
|
||||||
if 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:
|
else:
|
||||||
return call_qemu(args.path_to_qemu, [
|
return call_qemu(args.path_to_qemu, [
|
||||||
{
|
{
|
||||||
|
@ -4,23 +4,3 @@ if [ -z "${CPU_GATHER_PY}" ]; then
|
|||||||
echo >&2 "Do not call this script directly. Use 'cpu-gather.py' instead."
|
echo >&2 "Do not call this script directly. Use 'cpu-gather.py' instead."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user