Skip to contentSkip to conversation

vmstate-static-checker: fix size mismatch detection in unused fields

PATCH New Amit Shah 1 participant 1 message Jun 17, 2016 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Amit Shah

author
#1 lore raw

PATCH 1/1 vmstate-static-checker: fix size mismatch detection in unused fields

If a field changed from something to unused, the checker wasn't flagging if the field size mismatched. This was noticed in:

http://thread.gmane.org/gmane.comp.emulators.qemu/419802

where the 4->1 size change along with field name change to 'unused' wasn't being flagged. Fix this.

---
 scripts/vmstate-static-checker.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/vmstate-static-checker.py +1 -1
index b5ecaf6..14a27e7 100755
@@ -185,7 +185,7 @@ def check_fields(src_fields, dest_fields, desc, sec):
             if unused_count == 0:
                 advance_dest = True
 
-        if unused_count > 0:
+        if unused_count != 0:
             if advance_dest == False:
                 unused_count = unused_count - s_item["size"]
                 if unused_count == 0:
Signature · 1 line
2.7.4