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'.