From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34945) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoW0Z-00051o-9R for qemu-devel@nongnu.org; Tue, 20 Oct 2015 08:27:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZoW0W-0006Z3-0Z for qemu-devel@nongnu.org; Tue, 20 Oct 2015 08:27:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33888) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoW0V-0006Yx-Qa for qemu-devel@nongnu.org; Tue, 20 Oct 2015 08:27:11 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 6CB0869 for ; Tue, 20 Oct 2015 12:27:11 +0000 (UTC) Date: Tue, 20 Oct 2015 13:27:07 +0100 From: "Daniel P. Berrange" Message-ID: <20151020122707.GH14616@redhat.com> References: <1444648509-29179-1-git-send-email-berrange@redhat.com> <1444648509-29179-3-git-send-email-berrange@redhat.com> <5625690F.2090407@redhat.com> <56262EA9.2030004@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <56262EA9.2030004@redhat.com> Subject: Re: [Qemu-devel] [PATCH v2 02/16] sockets: move qapi_copy_SocketAddress into qemu-sockets.c Reply-To: "Daniel P. Berrange" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: qemu-devel@nongnu.org, "Dr. David Alan Gilbert" On Tue, Oct 20, 2015 at 02:08:09PM +0200, Paolo Bonzini wrote: > > > On 20/10/2015 00:05, Eric Blake wrote: > > > - qiv = qmp_input_visitor_new(obj); > > > - iv = qmp_input_get_visitor(qiv); > > > - visit_type_SocketAddress(iv, p_dest, NULL, &error_abort); > > > - qmp_input_visitor_cleanup(qiv); > > > - qobject_decref(obj); > > Interesting approach - it means that this copy will work no matter what > > further extensions we add into the qapi type. But rather heavyweight > > compared to just doing a memberwise copy, no? At any rate, this commit > > is straight code motion, so you did it correctly, but we may want to > > simplify things in a later commit. > > A memberwise copy requires you to allocate embedded objects (I'm not > sure whether your boxing changes can simplify this). It would probably be a nice idea if the QAPI code generator could emit an efficient copy func. So if someone wants an coding exercise.... In the mean time, this socket kaddress copy func is not called in any performance critical code paths, so the inefficiency doesn't particularly matter for now. Regards, Daniel -- |: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :| |: http://libvirt.org -o- http://virt-manager.org :| |: http://autobuild.org -o- http://search.cpan.org/~danberr/ :| |: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|