Re: [Qemu-devel] [PATCH 12/18] nbd: Less allocation during NBD_OPT_LIST

2016-04-09 Thread Eric Blake
On 04/09/2016 04:41 AM, Alex Bligh wrote: > > On 8 Apr 2016, at 23:05, Eric Blake wrote: > >> Since we know that the maximum name we are willing to accept >> is small enough to stack-allocate, rework the iteration over >> NBD_OPT_LIST responses to reuse a stack buffer rather than >> allocating e

Re: [Qemu-devel] [PATCH 12/18] nbd: Less allocation during NBD_OPT_LIST

2016-04-09 Thread Alex Bligh
On 8 Apr 2016, at 23:05, Eric Blake wrote: > Since we know that the maximum name we are willing to accept > is small enough to stack-allocate, rework the iteration over > NBD_OPT_LIST responses to reuse a stack buffer rather than > allocating every time. Furthermore, we don't even have to > all

[Qemu-devel] [PATCH 12/18] nbd: Less allocation during NBD_OPT_LIST

2016-04-08 Thread Eric Blake
Since we know that the maximum name we are willing to accept is small enough to stack-allocate, rework the iteration over NBD_OPT_LIST responses to reuse a stack buffer rather than allocating every time. Furthermore, we don't even have to allocate if we know the server's length doesn't match what