From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoViH-0004t6-I0 for qemu-devel@nongnu.org; Tue, 20 Oct 2015 08:08:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZoViB-0001KC-JK for qemu-devel@nongnu.org; Tue, 20 Oct 2015 08:08:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55843) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZoViB-0001Jl-EV for qemu-devel@nongnu.org; Tue, 20 Oct 2015 08:08:15 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id E1775461C3 for ; Tue, 20 Oct 2015 12:08:14 +0000 (UTC) References: <1444648509-29179-1-git-send-email-berrange@redhat.com> <1444648509-29179-3-git-send-email-berrange@redhat.com> <5625690F.2090407@redhat.com> From: Paolo Bonzini Message-ID: <56262EA9.2030004@redhat.com> Date: Tue, 20 Oct 2015 14:08:09 +0200 MIME-Version: 1.0 In-Reply-To: <5625690F.2090407@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 02/16] sockets: move qapi_copy_SocketAddress into qemu-sockets.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake , "Daniel P. Berrange" , qemu-devel@nongnu.org Cc: "Dr. David Alan Gilbert" 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). Paolo