From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34755) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5Byh-0003ZP-5Y for qemu-devel@nongnu.org; Wed, 17 Jun 2015 07:58:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5Byd-0006N1-3d for qemu-devel@nongnu.org; Wed, 17 Jun 2015 07:57:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50486) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5Byc-0006MQ-Vo for qemu-devel@nongnu.org; Wed, 17 Jun 2015 07:57:55 -0400 From: Juan Quintela In-Reply-To: <1434450415-11339-6-git-send-email-dgilbert@redhat.com> (David Alan Gilbert's message of "Tue, 16 Jun 2015 11:26:18 +0100") References: <1434450415-11339-1-git-send-email-dgilbert@redhat.com> <1434450415-11339-6-git-send-email-dgilbert@redhat.com> Date: Wed, 17 Jun 2015 13:57:52 +0200 Message-ID: <87h9q65yyn.fsf@neno.neno> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH v7 05/42] Add qemu_get_buffer_less_copy 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, 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_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: Juan Quintela I don't know still where this function is used, but function is correct. Can I suggest to change th ename to: qemu_get_buffer_in_place()? less_copy sounds ambigous to me :p