qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [RFC PATCH v1 2/5] VMState test: basic vmstate testing


From: Eric Blake
Subject: Re: [Qemu-devel] [RFC PATCH v1 2/5] VMState test: basic vmstate testing mechanism
Date: Mon, 07 Jul 2014 11:33:22 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0

On 07/07/2014 11:18 AM, Sanidhya Kashyap wrote:
> This patch introduces the mechanism to test the devices state by storing
> and dumping in in the QEMUFile pointer.
> 
> The testing is done as follows:
> 1) The VM is halted.
> 2) guest state is synchronized.
> 3) Then the device state is dumped to a temporary memory.
> 4) The guest state is reset.
> 5) Then the device state is loaded from the temporary memory.
> 6) The guest is resumed.
> 

> +
> +## @test-vmstates
> +#
> +# tests the vmstates' value by dumping and loading in memory
> +# @times: total iterations

Missing the #optional flag; what does it default to if not specified?

> +# @sinterval: sleep interval between iteration

in what unit?  Missing the #optional flag; what does it default to if
not specified?

> +#
> +# Since 2.1

You've missed hard freeze for 2.1; this is a new feature, and at the
earliest it can only be introduced in 2.2.

> +##
> +{ 'command': 'test-vmstates',
> +  'data': {'*times'     : 'int',
> +           '*sinterval' : 'int' } }

> +Arguments:
> +
> +- "times" :    the total iterations for vmstates testing. The default
> +               value is 10.
> +- "sinterval": the sleep interval between the iterations. The default
> +               value is 100 milliseconds.

Ah, you provided more documentation in the .hx file than in the .json.
I hate the redundancy, but it's better to include it in both files.

> +++ b/savevm.c
> @@ -1137,6 +1137,154 @@ void do_savevm(Monitor *mon, const QDict *qdict)
>      }
>  }
>  
> +#ifdef DEBUG_TEST_VMSTATES
> +#define DPRINTF(fmt, ...) \
> +    do { printf("vmstate_test: " fmt, ## __VA_ARGS__); } while (0)
> +#else
> +#define DPRINTF(fmt, ...) \
> +    do { } while (0)
> +#endif

Wasn't there another series proposed that ensures that even when
debugging is disabled that the compiler still compiles printf*
statements under an if(0) block to prevent bit-rot?  I didn't bother to
look it up now in the archives, but you should reuse that approach.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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