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 2/6] VMState test: get information about the registered devices
Date: Mon, 11 Aug 2014 10:24:27 -0600	[thread overview]
Message-ID: <53E8EE3B.5070502@redhat.com> (raw)
In-Reply-To: <1407565595-18861-3-git-send-email-sanidhya.iiith@gmail.com>

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

On 08/09/2014 12:26 AM, Sanidhya Kashyap wrote:
> Added both qmp and hmp interface to get the information about the devices that
> have been qdevified and are registered with the SaveVMHandlers. I have not used 
> any format to print the device information for the hmp interface. It would be
> great if anyone can give me some pointers about this about the printing format
> if there is something.
> 
> The qmp command to extract the information about the devices is
> qmp_query_devices which provides the list of device names and their respective
> version. The hmp command name is 'info devices' which lists the same information
> as provided by the qmp interface.
> 
> Signed-off-by: Sanidhya Kashyap <sanidhya.iiith@gmail.com>
> ---
>  hmp-commands.hx  |  2 ++
>  hmp.c            | 23 +++++++++++++++++++++++
>  hmp.h            |  1 +
>  monitor.c        |  7 +++++++
>  qapi-schema.json | 26 ++++++++++++++++++++++++++
>  qmp-commands.hx  | 43 +++++++++++++++++++++++++++++++++++++++++++
>  savevm.c         | 45 +++++++++++++++++++++++++++++++++++++++++++++
>  7 files changed, 147 insertions(+)
> 
> +++ b/qapi-schema.json
> @@ -3480,3 +3480,29 @@
>  # Since: 2.1
>  ##
>  { 'command': 'rtc-reset-reinjection' }
> +
> +##
> +# @QemuDevice
> +#
> +# device that is registered with SaveVMHandlers

This sounds like an internal implementation detail; is there a better
description more suited to what this struct represents from the API
point of view, maybe as simple as: "Information about a device"


> +{ 'command': 'query-devices',
> +  'returns': [ 'QemuDevice' ] }

Looks okay here...

> diff --git a/qmp-commands.hx b/qmp-commands.hx
> index 4be4765..e489197 100644
> --- a/qmp-commands.hx
> +++ b/qmp-commands.hx

> +
> +Example (1):

s/ (1)// - unless you have a second example, you don't need to label the
first example with a 1 suffix

> +
> +-> { "execute": "query-devices" }
> +<- { "return": [
> +       {
> +           [ { 'device-name': 'kvm-tpr-opt', 'version': 1 },

... but this doesn't match your command.  You have too many layers.
Also, QMP wire format uses ONLY ", never '.  It should look like:

{ "return": [ { "device-name": "kvm-tpr-opt", "version": 1 },
              ...
            ] }

In fact, rather than trying to write it by hand, actually compile your
code and test the actual QMP output and paste that in - then you'll know
you got it right.


> +static QemuDeviceList *create_device_list(const char *name, int version,
> +                                           QemuDeviceList *list)

Indentation is off.

-- 
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:24 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 [this message]
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
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=53E8EE3B.5070502@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).