qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kashyap Chamarthy <kchamart@redhat.com>
To: "Philippe Mathieu-Daudé" <philmd@redhat.com>
Cc: qemu-devel@nongnu.org, armbru@redhat.com,
	"Daniel P. Berrange" <berrange@redhat.com>
Subject: Re: [Qemu-devel] Should the "props" be documented for QMP `object-add`?
Date: Wed, 9 Jan 2019 11:44:43 +0100	[thread overview]
Message-ID: <20190109104443.GN3259@paraplu.home> (raw)
In-Reply-To: <16805fd6-6326-4acc-ee99-ac0899a8cf1e@redhat.com>

On Wed, Jan 09, 2019 at 11:31:18AM +0100, Philippe Mathieu-Daudé wrote:
> Hi Kashyap,

Hi,

> On 1/9/19 9:51 AM, Kashyap Chamarthy wrote:

[...]

> > That said, in qapi/misc.json "@object-add" doesn't document any of the
> > "props".  Is it on purpose?  Maybe because it is a 1:1 mapping of the
> > command-line `-object` (which _is_ documented in qemu-doc.texi).
> > 
> > Is it a good idea to send a patch to document the "props" in
> > qapi/misc.json?  Or would it be needless duplication?
> 
> IMHO the 1:1 mapping is only obvious for developpers who implement such
> commands and for 3rd party libs using QMP.

Even for developers who use QMP to implement higher layer tools, it
might take non-trivial amount of squinting to realize that it's a 1:1
mapping.  It should at least be mentioned in the relevant QMP doc
("explicit is better than implicit").  I'll submit a patch and see if it
flies. :-)

> For end-users, a command-line comment is helpful.
> 
> This remind me of this patch:
> 
> https://lists.gnu.org/archive/html/qemu-devel/2018-11/msg06623.html
> 
> +/**
> + * QAuthZSimple:
> + *
> + * This authorization driver provides a simple mechanism
> + * for granting access based on an exact matched username.
> + *
> + * To create an instance of this class via QMP:
> + *
> + *  {
> + *    "execute": "object-add",
> + *    "arguments": {
> + *      "qom-type": "authz-simple",
> + *      "id": "authz0",
> + *      "parameters": {
> + *        "identity": "fred"
> + *      }
> + *    }
> + *  }
> + *
> + * Or via the command line
> + *
> + *   -object authz-simple,id=authz0,identity=fred

Yeah, that's a convenient example.  And in this specific case, it is
useful for those reading the code.

-- 
/kashyap

  reply	other threads:[~2019-01-09 10:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-09  8:51 [Qemu-devel] Should the "props" be documented for QMP `object-add`? Kashyap Chamarthy
2019-01-09 10:31 ` Philippe Mathieu-Daudé
2019-01-09 10:44   ` Kashyap Chamarthy [this message]
2019-01-09 11:02 ` Daniel P. Berrangé
2019-01-09 11:21   ` Kashyap Chamarthy
2019-01-09 13:01   ` Markus Armbruster

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=20190109104443.GN3259@paraplu.home \
    --to=kchamart@redhat.com \
    --cc=armbru@redhat.com \
    --cc=berrange@redhat.com \
    --cc=philmd@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /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).