[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v5 03/15] libxl_qmp: Implement fd callback and read data [and 1 more messages]



Anthony PERARD writes ("Re: [PATCH v5 03/15] libxl_qmp: Implement fd callback 
and read data [and 1 more messages]"):
> On Mon, Oct 29, 2018 at 05:31:59PM +0000, Ian Jackson wrote:
> > To be honest this condition is a bit fiddly.  Why not do this after
> > subtracting buf_consumed from buf_used and copying the old data down ?
> 
> Somehow, that feels wrong to move the data inside the buffer.

You are going to have to move the data sometimes.  Suppose qemu keeps
sending you half messages and then pausing.  You'll never have an
empty buffer.

> > Then it would read
> >   if (!ev->buf_used)
> > 
> > But even better, if you change your code to permit ev->rx_buf != NULL
> > when ev->rx_buf_used==0, this code goes away completely.
> 
> I guess you mean to keep the buffer even once there's nothing left to
> parse? (And only free it once we call _dispose().)

Yes.  It seems simpler.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.