From patchwork Fri Jun 17 12:16:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Shah X-Patchwork-Id: 636984 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rWKFZ23f6z9t26 for ; Fri, 17 Jun 2016 22:24:50 +1000 (AEST) Received: from localhost ([::1]:56468 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDspM-0002PI-86 for incoming@patchwork.ozlabs.org; Fri, 17 Jun 2016 08:24:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41332) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDshg-0002Y8-DE for qemu-devel@nongnu.org; Fri, 17 Jun 2016 08:16:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bDshc-0003IF-Bm for qemu-devel@nongnu.org; Fri, 17 Jun 2016 08:16:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51117) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bDshc-0003IA-6N for qemu-devel@nongnu.org; Fri, 17 Jun 2016 08:16:48 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D825D64461 for ; Fri, 17 Jun 2016 12:16:47 +0000 (UTC) Received: from localhost (ovpn-116-17.sin2.redhat.com [10.67.116.17]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u5HCGfJ6026815; Fri, 17 Jun 2016 08:16:43 -0400 From: Amit Shah To: qemu list Date: Fri, 17 Jun 2016 17:46:39 +0530 Message-Id: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 17 Jun 2016 12:16:47 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/1] vmstate-static-checker: fix size mismatch detection in unused fields X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Amit Shah Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" 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. Signed-off-by: Amit Shah --- scripts/vmstate-static-checker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/vmstate-static-checker.py b/scripts/vmstate-static-checker.py index b5ecaf6..14a27e7 100755 --- a/scripts/vmstate-static-checker.py +++ b/scripts/vmstate-static-checker.py @@ -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: