Re: [Qemu-devel] [PATCH v6 08/47] Add qemu_get_buffer_less_copy to avoid copies some of the time

2015-05-21 Thread Amit Shah
On (Thu) 21 May 2015 [09:45:19], Dr. David Alan Gilbert wrote: > * Amit Shah (amit.s...@redhat.com) wrote: > > So we've got to assume that buf was allocated by the calling function, > > and since we're modifying the pointer (alternative idea to one above), > > should we unallocate it here? Can le

Re: [Qemu-devel] [PATCH v6 08/47] Add qemu_get_buffer_less_copy to avoid copies some of the time

2015-05-21 Thread Dr. David Alan Gilbert
* Amit Shah (amit.s...@redhat.com) wrote: > On (Tue) 14 Apr 2015 [18:03:34], Dr. David Alan Gilbert (git) wrote: > > From: "Dr. David Alan Gilbert" > > > > qemu_get_buffer always copies the data it reads to a users buffer, > > however in many cases the file buffer inside qemu_file could be given

Re: [Qemu-devel] [PATCH v6 08/47] Add qemu_get_buffer_less_copy to avoid copies some of the time

2015-05-21 Thread Amit Shah
On (Tue) 14 Apr 2015 [18:03:34], Dr. David Alan Gilbert (git) wrote: > From: "Dr. David Alan Gilbert" > > qemu_get_buffer always copies the data it reads to a users buffer, > however in many cases the file buffer inside qemu_file could be given > back to the caller, avoiding the copy. This isn't

[Qemu-devel] [PATCH v6 08/47] Add qemu_get_buffer_less_copy to avoid copies some of the time

2015-04-14 Thread Dr. David Alan Gilbert (git)
From: "Dr. David Alan Gilbert" qemu_get_buffer always copies the data it reads to a users buffer, however in many cases the file buffer inside qemu_file could be given back to the caller, avoiding the copy. This isn't always possible depending on the size and alignment of the data. Thus 'qemu_g