qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 11/11] test-vmstate: add test case to verify we


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 11/11] test-vmstate: add test case to verify we don't change VMState
Date: Wed, 23 Mar 2011 08:37:40 +0000

On Wed, Mar 23, 2011 at 12:16 AM, Anthony Liguori <address@hidden> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]