On Wed, Mar 23, 2011 at 12:16 AM, Anthony Liguori <aligu...@us.ibm.com> wrote: > +static QObject *read_current_schema(void) > +{ > + char buffer[65536]; > + int fd; > + int ret; > + size_t offset = 0; > + ssize_t len; > + > + ret = system("i386-softmmu/qemu -vmstate-dump > /tmp/schema.json");
Please don't hardcode i386-softmmu, there should at least be a way to override it. For example, I tend to build x86_64-softmmu only. Using a temporary file is not ideal because as soon as this program runs as part of an automated build system we could be clobbering the file if multiple runs are going in parallel. How about popen(3)? > diff --git a/vmstate/schema.json b/vmstate/schema.json > new file mode 100644 > index 0000000..23483ab > --- /dev/null > +++ b/vmstate/schema.json > @@ -0,0 +1,1176 @@ > +{ > + "cpu": { > + "mcg_cap": "uint64", > + "a20_mask": "int32", > + "tsc_offset": "uint64", > + "idt": { > + "flags": "uint32", > + "limit": "uint32", > + "selector": "uint32", > + "base": "uint32", > + "__version__": 1 > + }, Is field ordering important and did we lose that information as soon as we started using dicts to represent vmstate dumps? Stefan