From: Anthony PERARD <anthony.perard@citrix.com>
To: Ian Jackson <ian.jackson@citrix.com>
Cc: xen-devel@lists.xenproject.org, Wei Liu <wei.liu2@citrix.com>
Subject: Re: [PATCH v6.1 05/11] libxl_qmp: Implementation of libxl__ev_qmp_*
Date: Wed, 14 Nov 2018 16:33:15 +0000 [thread overview]
Message-ID: <20181114163315.GL1302@perard.uk.xensource.com> (raw)
In-Reply-To: <23532.17069.90374.75227@mariner.uk.xensource.com>
On Wed, Nov 14, 2018 at 03:43:41PM +0000, Ian Jackson wrote:
> (I finally remembered to drop the message-id from the CC header...)
:), I kept forgeting as well.
> Anthony PERARD writes ("Re: [PATCH v6.1 05/11] libxl_qmp: Implementation of libxl__ev_qmp_*"):
> > > But assuming that what you write here in your proposed comment is
> > > true, ...
> > >
> > > > State transition
> > > > connected -> waiting_reply
> > > > * -> state unchange
> > > > on error: disconnected
> > > > The state of the transmiting buffer will be changed.
> > >
> > > ... this looks good.
> >
> > Do I need to say here and everywhere else that on error the new state
> > isn't really disconnected, and that the ev_qmp needs to be cleaned?
> > On one hand, saying that the new state is disconnected means that the
> > ev_qmp functions that only deal with !disconnected, but on the other,
> > the caller still need to call _dispose.
>
> I think you are saying you can leave your ev_qmp in a state like
> disconnected, but with things allocated. Let us call that state
> `broken' (in internal nomenclature).
>
> But that state `broken' does not correspond to any of your public
> states. So your API document does not match the code.
>
> You need to either change the API to document this state as a public
> Broken state, or arrange for every ev_qmp-internal function to clean
> it up appropriately before control passes outside the ev_qmp
> implementation.
The current implementation already cleanup the broken state before the
control is passed outside ev_qmp implementation. That result in the Idle
public state. Whenever an internal function throw an error, it lets the
main function qmp_ev_fd_callback taking care of cleanup the `broken` state
so that when the control passes outside ev_qmp implementation the state
is disconnected/Idle.
An internal `broken` state is just an half-transition toward the
disconnected/Idle state.
I guess I could add to the internal state documentation:
When an internal function return an error, it can leave ev_qmp in a
`broken` state but only if the caller is another internal function.
That `broken` needs to be cleaned up, e.i. transitionned to the
`disconnected` state, before the control of ev_qmp is released
outsides of ev_qmp implementation.
Thanks,
--
Anthony PERARD
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2018-11-14 16:33 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 [this message]
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
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=20181114163315.GL1302@perard.uk.xensource.com \
--to=anthony.perard@citrix.com \
--cc=ian.jackson@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.