From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37213) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEZj7-00045R-Qz for qemu-devel@nongnu.org; Mon, 13 Jul 2015 05:08:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZEZj6-0007Dk-CB for qemu-devel@nongnu.org; Mon, 13 Jul 2015 05:08:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41332) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEZj6-0007Dd-7R for qemu-devel@nongnu.org; Mon, 13 Jul 2015 05:08:40 -0400 Date: Mon, 13 Jul 2015 14:38:28 +0530 From: Amit Shah Message-ID: <20150713090828.GC10280@grmbl.mre> References: <1434450415-11339-1-git-send-email-dgilbert@redhat.com> <1434450415-11339-6-git-send-email-dgilbert@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1434450415-11339-6-git-send-email-dgilbert@redhat.com> Subject: Re: [Qemu-devel] [PATCH v7 05/42] Add qemu_get_buffer_less_copy to avoid copies some of the time List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert (git)" Cc: aarcange@redhat.com, yamahata@private.email.ne.jp, quintela@redhat.com, liang.z.li@intel.com, qemu-devel@nongnu.org, luis@cs.umu.se, pbonzini@redhat.com, david@gibson.dropbear.id.au On (Tue) 16 Jun 2015 [11:26:18], 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 always possible > depending on the size and alignment of the data. > > Thus 'qemu_get_buffer_less_copy' either copies the data to a supplied > buffer or updates a pointer to the internal buffer if convenient. > > Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Amit Shah Amit