[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 16/18] sockets: Use new QAPI cloning
From: |
Daniel P. Berrange |
Subject: |
Re: [Qemu-devel] [PATCH v3 16/18] sockets: Use new QAPI cloning |
Date: |
Fri, 29 Apr 2016 09:30:56 +0100 |
User-agent: |
Mutt/1.5.24 (2015-08-30) |
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 <address@hidden>
>
> ---
> 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 :|
- Re: [Qemu-devel] [PATCH v3 03/18] qapi: Factor out JSON string escaping, (continued)
- [Qemu-devel] [PATCH v3 09/18] Revert "qjson: Simplify by using json-output-visitor", Eric Blake, 2016/04/29
- [Qemu-devel] [PATCH v3 08/18] qjson: Simplify by using json-output-visitor, Eric Blake, 2016/04/29
- [Qemu-devel] [PATCH v3 02/18] qapi: Improve use of qmp/types.h, Eric Blake, 2016/04/29
- [Qemu-devel] [PATCH v3 06/18] qapi: Add qstring_append_format(), Eric Blake, 2016/04/29
- [Qemu-devel] [PATCH v3 01/18] qapi: Rename (one) qjson.h to qobject-json.h, Eric Blake, 2016/04/29
- [Qemu-devel] [PATCH v3 11/18] qjson: Remove unused file, Eric Blake, 2016/04/29
- [Qemu-devel] [PATCH v3 16/18] sockets: Use new QAPI cloning, Eric Blake, 2016/04/29
- Re: [Qemu-devel] [PATCH v3 16/18] sockets: Use new QAPI cloning,
Daniel P. Berrange <=
- [Qemu-devel] [PATCH v3 04/18] qapi: Factor out JSON number formatting, Eric Blake, 2016/04/29
- [Qemu-devel] [PATCH v3 07/18] qapi: Add json output visitor, Eric Blake, 2016/04/29
- [Qemu-devel] [PATCH v3 10/18] vmstate: Use new JSON output visitor, Eric Blake, 2016/04/29
- [Qemu-devel] [PATCH v3 15/18] qapi: Add new clone visitor, Eric Blake, 2016/04/29
- [Qemu-devel] [PATCH v3 13/18] qapi: Support pretty printing in JSON output visitor, Eric Blake, 2016/04/29
- [Qemu-devel] [PATCH v3 14/18] qemu-img: Use new JSON output formatter, Eric Blake, 2016/04/29
- [Qemu-devel] [PATCH v3 12/18] qapi: Add qobject_to_json_pretty_prefix(), Eric Blake, 2016/04/29
- [Qemu-devel] [PATCH v3 17/18] replay: Use new QAPI cloning, Eric Blake, 2016/04/29