qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Sanidhya Kashyap <sanidhya.iiith@gmail.com>,
	qemu list <qemu-devel@nongnu.org>
Cc: "Dr. David Alan Gilbert" <dgilbert@redhat.com>,
	Juan Quintela <quintela@redhat.com>
Subject: Re: [Qemu-devel] [RFC PATCH v3 3/6] VMstate test: basic VMState testing mechanism
Date: Mon, 11 Aug 2014 10:32:00 -0600	[thread overview]
Message-ID: <53E8F000.2090409@redhat.com> (raw)
In-Reply-To: <1407565595-18861-4-git-send-email-sanidhya.iiith@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4273 bytes --]

On 08/09/2014 12:26 AM, Sanidhya Kashyap wrote:
> This patch implements the basic way of testing the VMStates' information
> whether it is correct or not while saving and loading the states. The qmp
> interface - test-vmstates can take three parameters as an input to test
> the device states. Now, one can check for any of the devices that have been
> registered with the SaveVMHandlers aka the migration protocol. Similarly,
> the hmp interface (test_vmstates) has only two input parameters - iterations and
> period.
> 

This paragraph:

vvvvvvv
> I have removed the following from the patch on previous comments:
> * replaed DPRINTF with trace_##name.
> * removed the noqdev and completely removed the support for resetting of devices
> based on qemu_system_reset()
^^^^^^^

should not be part of the commit message proper, but...

> 
> As Juan pointed out that there might be a memory leak as I did not close the
> QEMUFile pointer. But, it is not required as that pointer is directly referenced
> by the QEMUBuffer that has been implemented by David. So, IMHO the case pointed
> out by Juan does not exist.
> 
> 
> Signed-off-by: Sanidhya Kashyap <sanidhya.iiith@gmail.com>
> ---

...listed here, as a changelog to guide reviewers.  Remember, anything
before the --- should stand alone as what you would read in qemu.git,
without regards to how many revisions the patch went through; and
anything after the --- is useful for reviewers but intentionally
stripped by the maintainer when using 'git am' as fluff that doesn't
help explain the commit in isolation.

>  hmp-commands.hx  |  16 ++++
>  hmp.c            |  17 ++++
>  hmp.h            |   1 +
>  qapi-schema.json |  22 ++++++
>  qmp-commands.hx  |  33 ++++++++
>  savevm.c         | 233 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  trace-events     |   2 +
>  7 files changed, 324 insertions(+)
> 

> +++ b/qapi-schema.json
> @@ -3506,3 +3506,25 @@
>  ##
>  { 'command': 'query-devices',
>    'returns': [ 'QemuDevice' ] }
> +
> +##
> +# @test-vmstates
> +#
> +# tests the vmstates' value by dumping and loading in memory
> +#
> +# @iterations: (optional) The total iterations for vmstate testing.

For consistency, and in case we ever start generating documentation from
the .json file,
s/(optional)/#optional/

> +# The min and max defind value is 10 and 100 respectively.

s/defind value is/defined values are/

> +#
> +# @period: (optional) sleep interval between iteration (in milliseconds).

s/(optional)/#optional/

> +# The default interval is 100 milliseconds with min and max being
> +# 1 and 10000 respectively.
> +#
> +# @devices: (optional) helps in resetting particular device(s) that
> +# have been registered with SaveStateEntry.
> +#
> +# Since 2.2
> +##
> +{ 'command': 'test-vmstates',
> +  'data': {'*iterations':  'int',
> +           '*period':      'int',
> +           '*devices':   [ 'QemuDevice' ] } }

> +Example:
> +
> +-> { "execute": "test-vmstates",
> +     "arguments": {
> +        "iterations": 10,
> +        "period": 100, } }

That is not valid JSON.  You cannot have a trailing , inside {}.  Also,
it might be worth an example of the proper use of the optional "devices"
parameter.


> +
> +static inline bool test_vmstates_check_device_name(VMStateLogState *v,

The compiler is good enough about inlining static functions that you
seldom need to use 'inline'.  That, and 'static inline' has changed
semantics over the years of gcc, so you really want to avoid it unless
you know what you are doing.


> +static void test_vmstates_cb(void *opaque)
> +{
> +    VMStateLogState *v = opaque;
> +    int saved_vm_running = runstate_is_running();
> +    const QEMUSizedBuffer *qsb;

> +
> +        qsb = qemu_buf_get(f);
> +
> +        /* clearing the states of the guest */
> +        test_vmstates_reset_devices(v);
> +
> +        start_time = qemu_clock_get_ms(QEMU_CLOCK_REALTIME);
> +        f = qemu_bufopen("r", (QEMUSizedBuffer *)qsb);

Ewww.  Why are you casting away const?  Make qsb the correct type to
begin with.

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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 539 bytes --]

  reply	other threads:[~2014-08-11 16:32 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-09  6:26 [Qemu-devel] [RFC PATCH v3 0/6] VMState testing Sanidhya Kashyap
2014-08-09  6:26 ` [Qemu-devel] [RFC PATCH v3 1/6] QEMUSizedBuffer/QEMUFile Sanidhya Kashyap
2014-08-11  2:49   ` Gonglei (Arei)
2014-08-11 18:47     ` Dr. David Alan Gilbert
2014-08-11 19:16       ` Stefan Berger
2014-08-11 16:38   ` Eric Blake
2014-08-09  6:26 ` [Qemu-devel] [RFC PATCH v3 2/6] VMState test: get information about the registered devices Sanidhya Kashyap
2014-08-11 16:24   ` Eric Blake
2014-08-09  6:26 ` [Qemu-devel] [RFC PATCH v3 3/6] VMstate test: basic VMState testing mechanism Sanidhya Kashyap
2014-08-11 16:32   ` Eric Blake [this message]
2014-08-09  6:26 ` [Qemu-devel] [RFC PATCH v3 4/6] VMState test: querying the vmstate testing process Sanidhya Kashyap
2014-08-11 16:35   ` Eric Blake
2014-08-09  6:26 ` [Qemu-devel] [RFC PATCH v3 5/6] VMState test: update period of " Sanidhya Kashyap
2014-08-09  6:26 ` [Qemu-devel] [RFC PATCH v3 6/6] VMState test: cancel mechanism for an already running " Sanidhya Kashyap

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53E8F000.2090409@redhat.com \
    --to=eblake@redhat.com \
    --cc=dgilbert@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=quintela@redhat.com \
    --cc=sanidhya.iiith@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).