qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 02/16] sockets: move qapi_copy_SocketAddress


From: Daniel P. Berrange
Subject: Re: [Qemu-devel] [PATCH v2 02/16] sockets: move qapi_copy_SocketAddress into qemu-sockets.c
Date: Tue, 20 Oct 2015 13:27:07 +0100
User-agent: Mutt/1.5.24 (2015-08-30)

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 :|



reply via email to

[Prev in Thread] Current Thread [Next in Thread]