From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=47662 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q2DrN-0005M7-49 for qemu-devel@nongnu.org; Tue, 22 Mar 2011 22:31:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q2DrM-0008Mx-1X for qemu-devel@nongnu.org; Tue, 22 Mar 2011 22:31:44 -0400 Received: from mail-yw0-f45.google.com ([209.85.213.45]:41864) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q2DrL-0008Mm-Tv for qemu-devel@nongnu.org; Tue, 22 Mar 2011 22:31:43 -0400 Received: by ywl41 with SMTP id 41so3837938ywl.4 for ; Tue, 22 Mar 2011 19:31:43 -0700 (PDT) Message-ID: <4D895B88.9080904@codemonkey.ws> Date: Tue, 22 Mar 2011 21:31:36 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 11/11] test-vmstate: add test case to verify we don't change VMState References: <1300839376-22520-1-git-send-email-aliguori@us.ibm.com> <1300839376-22520-12-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1300839376-22520-12-git-send-email-aliguori@us.ibm.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jan Kiszka , qemu-devel@nongnu.org, Juan Quintela On 03/22/2011 07:16 PM, Anthony Liguori wrote: > We've had lots of issues surrounding live migration breaking. This is because > we haven't had a good way to validate that what we're migrating isn't changing > underneath of us. > > This test works by first converting the in-tree schema to C source as a string. > This is built into the test case. The test case will then query QEMU for the > current schema. > > It converts both strings to QObjects via the JSON parser and then does a > recursive diff. Unlike a simple diff command, this lets us say exactly what you > did to break migration. For instance, you get error messages like: > > You broke migration by changing the type of field 'par' in device 'cpu', > version 1 from 'uint32' to 'uint64'. > > It only covers devices that support VMState and it currently doesn't look at > subsections yet. > > The in-tree schema needs to be updated whenever migration changes but this ends > up being a very nice way to ensure that we're reviewing migration protocol > changes. > > The test case is built in the default build, and can be run by `make check'. This test takes a disturbingly long time to run considering what it's doing (~3 seconds). Turns out, the JSON parser is horribly slow because it allocates and frees memory faster than a hummingbird on steroids. I have a local patch that removes this and afterwards the test runs in just 70ms. I'll send that fix out tomorrow. Regards, Anthony Liguori