mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-22 05:35:25 +00:00
Merge branch 'fix-cpumap-version' into 'master'
cpu_map : sync_qemu_models : fix versionned models See merge request libvirt/libvirt!258
This commit is contained in:
commit
96ca2b20ce
@ -429,9 +429,10 @@ def expand_model(model):
|
||||
"""Expand a qemu cpu model description that has its feature split up into
|
||||
different fields and may have differing versions into several libvirt-
|
||||
friendly cpu models."""
|
||||
name = model.pop(".name")
|
||||
|
||||
result = {
|
||||
"name": model.pop(".name"),
|
||||
"name": name,
|
||||
"vendor": translate_vendor(model.pop(".vendor")),
|
||||
"features": set(),
|
||||
"extra": dict()}
|
||||
@ -454,7 +455,8 @@ def expand_model(model):
|
||||
|
||||
for version in versions:
|
||||
result = copy.deepcopy(result)
|
||||
result["name"] = version.pop(".alias", result["name"])
|
||||
version_num = version.pop(".version", '1')
|
||||
result["name"] = name + "-v" + version_num
|
||||
|
||||
props = version.pop(".props", dict())
|
||||
for k, v in props:
|
||||
@ -475,6 +477,11 @@ def expand_model(model):
|
||||
|
||||
yield result
|
||||
|
||||
alias = version.pop(".alias", None)
|
||||
if alias:
|
||||
result = copy.deepcopy(result)
|
||||
result["name"] = alias
|
||||
yield result
|
||||
|
||||
def output_model(f, model):
|
||||
if model["extra"]:
|
||||
|
Loading…
Reference in New Issue
Block a user