[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v3 43/43] qobject: move dump_qobject() from bloc
From: |
Marc-André Lureau |
Subject: |
Re: [Qemu-devel] [PATCH v3 43/43] qobject: move dump_qobject() from block/ to qobject/ |
Date: |
Fri, 9 Jun 2017 06:15:21 -0400 (EDT) |
Hi
----- Original Message -----
> >
> > The title claims "move dump_qobject() from block/ to qobject/", but
> > that's not what the patch does. It *replaces* dump_qobject() by
> > qobject_to_string(). The former dumps to a callback, the latter to a
> > dynamic string buffer.
> >
> > Providing dump functionality in one way doesn't preclude the other way:
> > given callback, one could define a callback that builds up a string
> > buffer, and given buffer, one could (and you actually do) pass the
> > buffer to a callback. That's less efficient, though.
> >
> > Trading efficiency for ease-of-use should be okay here, but I'm cc'ing
> > Max and Kevin to double-check.
>
> I believe convenience is more important than efficiency here. It's easy to
> call qobject_to_string(foo) from gdb for example, with a callback, it's less
> easy.
>
> (fprintf or monitor_fprintf will both build an internal buffer anyway,
> efficiency is probably similar)
>
Hmm, there are more allocations in qobject_to_string() though
- [Qemu-devel] [PATCH v3 38/43] numa: use get_uint() for "size" property, (continued)
- [Qemu-devel] [PATCH v3 38/43] numa: use get_uint() for "size" property, Marc-André Lureau, 2017/06/07
- [Qemu-devel] [PATCH v3 39/43] i386/cpu: use get_uint() for "min-level"/"min-xlevel" properties, Marc-André Lureau, 2017/06/07
- [Qemu-devel] [PATCH v3 40/43] console: use get_uint() for "head" property, Marc-André Lureau, 2017/06/07
- [Qemu-devel] [PATCH v3 41/43] tests/qdict: check more get_try_int() cases, Marc-André Lureau, 2017/06/07
- [Qemu-devel] [PATCH v3 42/43] RFC: qdict: add uint, Marc-André Lureau, 2017/06/07
- [Qemu-devel] [PATCH v3 43/43] qobject: move dump_qobject() from block/ to qobject/, Marc-André Lureau, 2017/06/07
- Re: [Qemu-devel] [PATCH v3 43/43] qobject: move dump_qobject() from block/ to qobject/, Max Reitz, 2017/06/09
Re: [Qemu-devel] [PATCH v3 00/43] qobject/qapi: add uint type, no-reply, 2017/06/07
Re: [Qemu-devel] [PATCH v3 00/43] qobject/qapi: add uint type, no-reply, 2017/06/07
Re: [Qemu-devel] [PATCH v3 00/43] qobject/qapi: add uint type, Markus Armbruster, 2017/06/09