From: Ian Jackson <ian.jackson@citrix.com>
To: Anthony PERARD <anthony.perard@citrix.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wei.liu2@citrix.com>
Subject: Re: [PATCH v6.2 05/11] libxl_qmp: Implementation of libxl__ev_qmp_*
Date: Fri, 16 Nov 2018 18:16:25 +0000 [thread overview]
Message-ID: <23535.2425.441158.740263@mariner.uk.xensource.com> (raw)
In-Reply-To: <20181116171046.GP1302@perard.uk.xensource.com>
Anthony PERARD writes ("Re: [PATCH v6.2 05/11] libxl_qmp: Implementation of libxl__ev_qmp_*"):
> On Fri, Nov 16, 2018 at 04:09:03PM +0000, Ian Jackson wrote:
> > Anthony PERARD writes ("Re: [PATCH v6.2 05/11] libxl_qmp: Implementation of libxl__ev_qmp_*"):
> > > I wanted to reduce the number of function calls between when a user
> > > callback is called and when ev_qmp's control passes outsite of ev_qmp's
> > > implementation. So I moved qmp_ev_handle_message() call here.
> >
> > Why did you want to reduce the number of function calls ?
>
> Well, there is a need to track that `ev` might be discarded, and the
> only way left is via a return value. It is probably easier to follow if
> less function have the possibility that a user callback have been
> called.
Oh, I see. Hrm. OK, I think I would have done it the other way, but
that makes sense.
> > I think a bare \n is not legal and should be treated as a protocol
> > error. Don't you agree ? Given that, you can search for \n, and if
> > it is not preceded by \r, call it an error.
>
> I can't find anything that say bare \n are not legal. \n is part of
> rfc7159, which the qmp-spec mentions when speaking about JSON data
> structures. It is even possible to ask QEMU to add bare \n, this is done
> with pretty=on.
I think I was wrong. So thanks for explaining and you should leave
this code the way it is.
> > I'm not sure I can see sensible a way of doing this that doesn't have
> > *three* id variables:
> > - a counter for generating new ids
> > - the id put in the capabilities command
> > - the id put in the user's command
>
> That sounds fine.
If you have another approach to suggest please go ahead.
> > Oh, is the purpose to inform qemu what our capabilities are ?
>
> It actually inform qemu of the capabilities we want. The QMP server will
> not accept any other commands before the client execute qmp_capabilities.
>
> The conversation between QEMU and libxl goes like this:
>
> QEMU: Hi, I'm QEMU 3.0, I can do "oob".
> libxl: Hi, I don't need any capabilities.
> QEMU: Thanks, you can now run any other command you like.
> libxl sends the user command.
>
> Or in term of edited JSON:
> QEMU: { "QMP": {"version": XXX, "capabilities": ["oob"] } }
> libxl: { "execute": "qmp_capabilities", "arguments": {} }
> QEMU: { "return": {}}
Thanks for the explanation.
> And here is a link to the example in the QMP spec document
> (3. QMP Examples):
> https://git.qemu.org/?p=qemu.git;a=blob;f=docs/interop/qmp-spec.txt;h=8f7da0245d51447be7df2b3d4b105bad9fbec0b3;hb=HEAD#l244
>
> Maybe I should add somewhere in a comment where to find the QMP spec,
> even so we already have "This file implement a client for QMP (QEMU
> Monitor Protocol). For the Specification, see in the QEMU repository."
> at the top of libxl_qmp.c
Sorry for pontificating without having read the spec myself ... but
yes a link would be nice.
Thanks,
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
prev parent reply other threads:[~2018-11-16 18:16 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-13 12:28 [PATCH v6.1 05/11] libxl_qmp: Implementation of libxl__ev_qmp_* Anthony PERARD
2018-11-13 13:14 ` Ian Jackson
2018-11-13 15:42 ` Anthony PERARD
2018-11-13 16:10 ` Ian Jackson
2018-11-14 11:40 ` Anthony PERARD
2018-11-14 15:43 ` Ian Jackson
2018-11-14 15:49 ` Ian Jackson
2018-11-14 16:33 ` Anthony PERARD
2018-11-14 17:07 ` Ian Jackson
2018-11-15 11:15 ` [PATCH v6.2 " Anthony PERARD
2018-11-15 18:40 ` Ian Jackson
2018-11-16 14:53 ` Anthony PERARD
2018-11-16 16:09 ` Ian Jackson
2018-11-16 17:10 ` Anthony PERARD
2018-11-16 18:16 ` Ian Jackson [this message]
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=23535.2425.441158.740263@mariner.uk.xensource.com \
--to=ian.jackson@citrix.com \
--cc=anthony.perard@citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.