From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43669) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aw3pb-0007CJ-Tz for qemu-devel@nongnu.org; Fri, 29 Apr 2016 04:31:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aw3pU-00029p-8K for qemu-devel@nongnu.org; Fri, 29 Apr 2016 04:31:22 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33762) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aw3pU-00026j-3c for qemu-devel@nongnu.org; Fri, 29 Apr 2016 04:31:16 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 77CAB8AE73 for ; Fri, 29 Apr 2016 08:31:06 +0000 (UTC) Date: Fri, 29 Apr 2016 09:30:56 +0100 From: "Daniel P. Berrange" Message-ID: <20160429083056.GC21525@redhat.com> Reply-To: "Daniel P. Berrange" References: <1461903820-3092-1-git-send-email-eblake@redhat.com> <1461903820-3092-17-git-send-email-eblake@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1461903820-3092-17-git-send-email-eblake@redhat.com> Subject: Re: [Qemu-devel] [PATCH v3 16/18] sockets: Use new QAPI cloning List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Eric Blake Cc: qemu-devel@nongnu.org, armbru@redhat.com, famz@redhat.com, Gerd Hoffmann , Paolo Bonzini On Thu, Apr 28, 2016 at 10:23:37PM -0600, Eric Blake wrote: > Rather than rolling our own clone via an expensive conversion > in and back out of QObject, use the generated QAPI version. > > Signed-off-by: Eric Blake > > --- > v3: new patch > --- > util/qemu-sockets.c | 22 +--------------------- > 1 file changed, 1 insertion(+), 21 deletions(-) > > diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c > index 2a2c524..6b70944 100644 > --- a/util/qemu-sockets.c > +++ b/util/qemu-sockets.c > @@ -1129,25 +1129,5 @@ SocketAddress *socket_remote_address(int fd, Error **errp) > void qapi_copy_SocketAddress(SocketAddress **p_dest, > SocketAddress *src) > { > - QmpOutputVisitor *qov; > - QmpInputVisitor *qiv; > - Visitor *ov, *iv; > - QObject *obj; > - > - *p_dest = NULL; > - > - qov = qmp_output_visitor_new(); > - ov = qmp_output_get_visitor(qov); > - visit_type_SocketAddress(ov, NULL, &src, &error_abort); > - obj = qmp_output_get_qobject(qov); > - qmp_output_visitor_cleanup(qov); > - if (!obj) { > - return; > - } > - > - qiv = qmp_input_visitor_new(obj, true); > - iv = qmp_input_get_visitor(qiv); > - visit_type_SocketAddress(iv, NULL, p_dest, &error_abort); > - qmp_input_visitor_cleanup(qiv); > - qobject_decref(obj); > + *p_dest = qapi_SocketAddress_clone(src); > } Since it is only one line long, this method is now rather pointless. I'd suggest just deleting it entirely and updating the callers to use the real clone method directly. 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 :|