Merge remote-tracking branch 'remotes/amit-migration/for-2.1' into staging
* remotes/amit-migration/for-2.1: vmstate static checker: detect section renames Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
commit
231f6927c8
|
@ -79,6 +79,18 @@ def check_fields_match(name, s_field, d_field):
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
def get_changed_sec_name(sec):
|
||||||
|
# Section names can change -- see commit 292b1634 for an example.
|
||||||
|
changes = {
|
||||||
|
"ICH9 LPC": "ICH9-LPC",
|
||||||
|
}
|
||||||
|
|
||||||
|
for item in changes:
|
||||||
|
if item == sec:
|
||||||
|
return changes[item]
|
||||||
|
if changes[item] == sec:
|
||||||
|
return item
|
||||||
|
return ""
|
||||||
|
|
||||||
def exists_in_substruct(fields, item):
|
def exists_in_substruct(fields, item):
|
||||||
# Some QEMU versions moved a few fields inside a substruct. This
|
# Some QEMU versions moved a few fields inside a substruct. This
|
||||||
|
@ -314,13 +326,18 @@ def main():
|
||||||
dest_data = temp
|
dest_data = temp
|
||||||
|
|
||||||
for sec in src_data:
|
for sec in src_data:
|
||||||
if not sec in dest_data:
|
dest_sec = sec
|
||||||
print "Section \"" + sec + "\" does not exist in dest"
|
if not dest_sec in dest_data:
|
||||||
bump_taint()
|
# Either the section name got changed, or the section
|
||||||
continue
|
# doesn't exist in dest.
|
||||||
|
dest_sec = get_changed_sec_name(sec)
|
||||||
|
if not dest_sec in dest_data:
|
||||||
|
print "Section \"" + sec + "\" does not exist in dest"
|
||||||
|
bump_taint()
|
||||||
|
continue
|
||||||
|
|
||||||
s = src_data[sec]
|
s = src_data[sec]
|
||||||
d = dest_data[sec]
|
d = dest_data[dest_sec]
|
||||||
|
|
||||||
if sec == "vmschkmachine":
|
if sec == "vmschkmachine":
|
||||||
check_machine_type(s, d)
|
check_machine_type(s, d)
|
||||||
|
|
Loading…
Reference in a new issue