From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41188) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGsOj-0000n8-Mt for qemu-devel@nongnu.org; Mon, 11 Aug 2014 12:24:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XGsOe-0006kq-OK for qemu-devel@nongnu.org; Mon, 11 Aug 2014 12:24:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:45929) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XGsOe-0006kk-GZ for qemu-devel@nongnu.org; Mon, 11 Aug 2014 12:24:32 -0400 Message-ID: <53E8EE3B.5070502@redhat.com> Date: Mon, 11 Aug 2014 10:24:27 -0600 From: Eric Blake MIME-Version: 1.0 References: <1407565595-18861-1-git-send-email-sanidhya.iiith@gmail.com> <1407565595-18861-3-git-send-email-sanidhya.iiith@gmail.com> In-Reply-To: <1407565595-18861-3-git-send-email-sanidhya.iiith@gmail.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="uvo1kuVSd7NAK7UNw3vA2eCbAOkFCBJks" Subject: Re: [Qemu-devel] [RFC PATCH v3 2/6] VMState test: get information about the registered devices List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Sanidhya Kashyap , qemu list Cc: "Dr. David Alan Gilbert" , Juan Quintela This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --uvo1kuVSd7NAK7UNw3vA2eCbAOkFCBJks Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 08/09/2014 12:26 AM, Sanidhya Kashyap wrote: > Added both qmp and hmp interface to get the information about the devic= es that > have been qdevified and are registered with the SaveVMHandlers. I have = not used=20 > any format to print the device information for the hmp interface. It wo= uld be > great if anyone can give me some pointers about this about the printing= format > if there is something. >=20 > The qmp command to extract the information about the devices is > qmp_query_devices which provides the list of device names and their res= pective > version. The hmp command name is 'info devices' which lists the same in= formation > as provided by the qmp interface. >=20 > Signed-off-by: Sanidhya Kashyap > --- > 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(+) >=20 > +++ 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 }, =2E.. 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 versio= n, > + QemuDeviceList *list) Indentation is off. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --uvo1kuVSd7NAK7UNw3vA2eCbAOkFCBJks Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg iQEcBAEBCAAGBQJT6O47AAoJEKeha0olJ0NqmncH/3nqodBr3EZHsIl987fymCO7 anfufMxim/9FhW/hNxvlh0z5FmA1WXiqeLs8h4Omh1FWpzpI49HQJQIG6IDCfE37 LXRjvpC9+gM3Hnxqgbpb6mvz58Ges7hC6M6/liZ1w591xe3d5M3T1hYaDMrw2K0P tc4hUBLabebpn1sTeEm7PjJTxXPalVxRJKqsV615WzHWFT25801odCYe8ImRF9i6 evoDsQ6+q0N0SeI9pnqHteVqLgluUXdV/vAWVQ9x22W6ieawvZ14JC+dYwu6mPqq cCPnLtAKsDpzObJoO/zpooQShyOBwHHwo/u0uGQuUDW3IyPfStn3EkqA9bw95RM= =k6Tx -----END PGP SIGNATURE----- --uvo1kuVSd7NAK7UNw3vA2eCbAOkFCBJks--