aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-07-17 12:17:28 +0100
committerPeter Maydell <peter.maydell@linaro.org>2014-07-17 12:17:28 +0100
commit231f6927c813d2e4f49e5aeb20ebd236b391bce8 (patch)
tree7a9eb021e0470f362076d85c98aa71f5689c47cb
parent104369c8c7c116e7656ee6344d66ac872fd86143 (diff)
parent79fe16c0489ca658f53796206067a551fc915ba2 (diff)
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>
-rwxr-xr-xscripts/vmstate-static-checker.py27
1 files changed, 22 insertions, 5 deletions
diff --git a/scripts/vmstate-static-checker.py b/scripts/vmstate-static-checker.py
index 1604e680dc..3bae769a37 100755
--- a/scripts/vmstate-static-checker.py
+++ b/scripts/vmstate-static-checker.py
@@ -79,6 +79,18 @@ def check_fields_match(name, s_field, d_field):
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):
# Some QEMU versions moved a few fields inside a substruct. This
@@ -314,13 +326,18 @@ def main():
dest_data = temp
for sec in src_data:
- if not sec in dest_data:
- print "Section \"" + sec + "\" does not exist in dest"
- bump_taint()
- continue
+ dest_sec = sec
+ if not dest_sec in dest_data:
+ # Either the section name got changed, or the section
+ # 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]
- d = dest_data[sec]
+ d = dest_data[dest_sec]
if sec == "vmschkmachine":
check_machine_type(s, d)