Received: from eggs.gnu.org ([2001:4830:134:3::10]:45847) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvihU-0007jh-4U for qemu-devel@nongnu.org; Mon, 09 Nov 2015 04:25:25 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZvihR-0004gT-8d for qemu-devel@nongnu.org; Mon, 09 Nov 2015 04:25:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39762) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZvihR-0004gK-4E for qemu-devel@nongnu.org; Mon, 09 Nov 2015 04:25:17 -0500 From: Juan Quintela In-Reply-To: <1446747083-18205-9-git-send-email-dgilbert@redhat.com> (David Alan Gilbert's message of "Thu, 5 Nov 2015 18:10:35 +0000") References: <1446747083-18205-1-git-send-email-dgilbert@redhat.com> <1446747083-18205-9-git-send-email-dgilbert@redhat.com> Date: Mon, 09 Nov 2015 10:25:14 +0100 Message-ID: <87h9kved8l.fsf@emacs.mitica> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v9 08/56] Add qemu_get_buffer_in_place to avoid copies some of the time Reply-To: quintela@redhat.com 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, liang.z.li@intel.com, qemu-devel@nongnu.org, luis@cs.umu.se, bharata@linux.vnet.ibm.com, amit.shah@redhat.com, pbonzini@redhat.com, david@gibson.dropbear.id.au "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_in_place' 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: Juan Quintela