xen-devel
Re: [Xen-devel] [PATCH 5/7] libxl_qmp, Return the callback return code i
On Fri, 2011-10-07 at 16:23 +0100, Anthony PERARD wrote:
> >> @@ -416,7 +418,7 @@ static int qmp_next(libxl__gc *gc,
> libxl__qmp_handler *qmp)
> >> s = end + 2;
> >>
> >> if (o) {
> >> - qmp_handle_response(qmp, o);
> >> + rc = qmp_handle_response(qmp, o);
> >
> > If rc now indicates error do we need to bail straight away or need
> to
> > keep going around this loop? (Or is it certain we will immediately
> fall
> > out of the loop after this?)
>
> We can not be sure that we will return, because it could be another
> message in the butffer. So I should return if there is a protocol
> error. But I think that I should keep seperate the return code of a
> callback, so only the interested function (qmp_synchronous_send) will
> read it (and return to the caller).
I think this means the caller cannot tell which request or how many
errors have occurred in total.
I think that the callbacks should take a success/error code. If that
particular function is interested in propagating the error then they can
save it in their opaque data pointer to be retrieved by the caller of
the sync_send.
Another alternative could be to add an rc member to callback_id_pair
(making it more of a qmp request handle than an callback/id pair) and
push the allocation/free of that datastructure back up into the caller
of qmp_send (perhaps many callers of sync_send would just use an on
stack variable). Callers could then check the result of a specific
request by looking at that new member.
Ian.
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
|
<Prev in Thread] |
Current Thread |
[Next in Thread>
|
- Re: [Xen-devel] [PATCH 1/7] libxl, Introduce dm-version xenstore key., (continued)
[Xen-devel] [PATCH 3/7] libxl_qmp, Introduce list of arguments to qmp_send, Anthony PERARD
[Xen-devel] [PATCH 4/7] libxl_qmp, Always insert a command id in the callback_list., Anthony PERARD
[Xen-devel] [PATCH 5/7] libxl_qmp, Return the callback return code in qmp_next., Anthony PERARD
[Xen-devel] [PATCH 7/7] libxl, Use QMP to insert a passthrough device when using upstream QEMU, Anthony PERARD
[Xen-devel] [PATCH 2/7] libxl_qmp, Introduce an opaque argument to the callbacks., Anthony PERARD
[Xen-devel] [PATCH 6/7] libxl_qmp, Introduce libxl__qmp_pci_add., Anthony PERARD
|
|
|