From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51363) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxDZb-0002HS-QA for qemu-devel@nongnu.org; Wed, 18 Jun 2014 06:58:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WxDZV-0007Yw-Kw for qemu-devel@nongnu.org; Wed, 18 Jun 2014 06:58:35 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29318) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WxDZV-0007Ys-Co for qemu-devel@nongnu.org; Wed, 18 Jun 2014 06:58:29 -0400 Date: Wed, 18 Jun 2014 16:28:22 +0530 From: Amit Shah Message-ID: <20140618105822.GL29732@grmbl.mre> References: <32593ed6bfc27fe8192677a69aa2adaa7ed9c11b.1403079139.git.amit.shah@redhat.com> <87lhsuijk3.fsf@troll.troll> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87lhsuijk3.fsf@troll.troll> Subject: Re: [Qemu-devel] [PATCH v4 02/18] vmstate-static-checker: script to validate vmstate changes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Juan Quintela Cc: qemu list , Markus Armbruster , Alexander Graf , "Dr. David Alan Gilbert" , Paolo Bonzini , Andreas =?iso-8859-1?Q?F=E4rber?= On (Wed) 18 Jun 2014 [12:44:12], Juan Quintela wrote: > Amit Shah wrote: > > This script compares the vmstate dumps in JSON format as output by QEMU > > with the -dump-vmstate option. > > > > It flags various errors, like version mismatch, sections going away, > > size mismatches, etc. > > > > This script is tolerant of a few changes that do not change the on-wire > > format, like embedding a few fields within substructs. > > > > The script takes -s/--src and -d/--dest parameters, to which filenames > > are given as arguments. > > > > Signed-off-by: Amit Shah > > > > > +def check_fields_match(s_field, d_field): > > + if s_field == d_field: > > + return True > > + > > + # Some fields changed names between qemu versions. This list > > + # is used to whitelist such changes. > > + changed_names = [ > > + ['d', 'dev', 'pcidev', 'pci_dev', 'parent_obj'], > > + ['card', 'parent_obj'], > > + ['bridge.dev', 'parent_obj'], > > + ['br.dev', 'parent_obj.parent_obj'], > > + ['port.br.dev', 'parent_obj.parent_obj.parent_obj'], > > + ['port.br.dev.exp.aer_log', > > + 'parent_obj.parent_obj.parent_obj.exp.aer_log'], > > + ['br.dev.exp.aer_log', > > + 'parent_obj.parent_obj.exp.aer_log'], > > + ['shpc', 'bridge.dev.shpc'], > > + ['pci0_status', > > + 'acpi_pci_hotplug.acpi_pcihp_pci_status[0x0]'], > > + ['pci_irq_levels', 'pci_irq_levels_vmstate'], > > + ['usb-ptr-queue', 'HIDPointerEventQueue'], > > + ['num_surfaces', 'ssd.num_surfaces'], > > + ['timer', 'timer_expiry'], > > + ] > > I expect this not to be very big, so ... could we prepend the VMState > description name on this? > > "usb-ptr-queue" and "HIDPointerEventQueue" are quite descriptive, but > > "d" "dev" "pci_dev" ... > > I am not sure that we want to do this translation for any > VMSTateDescription. In particular, we are ending that parent_obj can > match with anything :-() Hm; so a 1-1 mapping of stuff that changed. A similar mapping will have to be created for all vmsds. I'll take a look at it. Do you want to hold off this series till that, or should I just send a follow-up patch (series) once I get something? > My python is rusty (to be generous with me), so I am assuming rest of > things are idiomatic Python O:-) Heh, I'm hoping so too -- I'm learning python on-the-go with this script. Amit