Re: [Xen-devel] [RFC v2 4/9] libxl_qmp: Move the buffer realloc to the same scope level as read

2018-04-23 Thread Wei Liu
On Mon, Apr 23, 2018 at 03:50:27PM +0100, Anthony PERARD wrote: > On Mon, Apr 23, 2018 at 10:03:39AM +0100, Wei Liu wrote: > > On Mon, Apr 16, 2018 at 06:32:22PM +0100, Anthony PERARD wrote: > > > In qmp_next(), the inner loop should only try to parse messages from > > > QMP, if there is more than

Re: [Xen-devel] [RFC v2 4/9] libxl_qmp: Move the buffer realloc to the same scope level as read

2018-04-23 Thread Anthony PERARD
On Mon, Apr 23, 2018 at 10:03:39AM +0100, Wei Liu wrote: > On Mon, Apr 16, 2018 at 06:32:22PM +0100, Anthony PERARD wrote: > > In qmp_next(), the inner loop should only try to parse messages from > > QMP, if there is more than one. > > > > The handling of the receive buffer ('incomplete'), should

Re: [Xen-devel] [RFC v2 4/9] libxl_qmp: Move the buffer realloc to the same scope level as read

2018-04-23 Thread Wei Liu
On Mon, Apr 16, 2018 at 06:32:22PM +0100, Anthony PERARD wrote: > In qmp_next(), the inner loop should only try to parse messages from > QMP, if there is more than one. > > The handling of the receive buffer ('incomplete'), should be done at the > same scope level as read(). It doesn't need to be

[Xen-devel] [RFC v2 4/9] libxl_qmp: Move the buffer realloc to the same scope level as read

2018-04-16 Thread Anthony PERARD
In qmp_next(), the inner loop should only try to parse messages from QMP, if there is more than one. The handling of the receive buffer ('incomplete'), should be done at the same scope level as read(). It doesn't need to be handle more that once after a read. Before this patch, when on message wh