[libvirt] [PATCH v2 1/2] util: eliminate duplicate function virDBusMessageRead

Daniel P. Berrangé berrange at redhat.com
Mon Apr 15 09:13:48 UTC 2019


On Fri, Apr 12, 2019 at 01:26:57PM -0400, Laine Stump wrote:
> When virDBusMessageRead() and virDBusMessageDecode were first added in
> commit 834c9c94, they were identical except that virDBusMessageRead()
> would unref the message after decoding it.
> 
> This difference was eliminated later in commit dc7f3ffc after it
> became apparent that unref-ing the message so soon was never the right
> thing to do. The two identical functions remained though, with the
> tests and virDBus library itself calling the Decode variant, and all
> other users calling the Read variant.
> 
> This patch eliminates the duplication, switching all users to
> virDBusMessageDecode (and moving the nice API documentation comment
> from the Read function up to the Decode function).
> 
> Signed-off-by: Laine Stump <laine at laine.org>
> ---
>  src/libvirt_private.syms |  1 -
>  src/util/virdbus.c       | 53 +++++++++++++---------------------------
>  src/util/virdbus.h       |  4 +--
>  src/util/virdbuspriv.h   |  4 ---
>  src/util/virfirewalld.c  |  8 +++---
>  src/util/virpolkit.c     | 12 ++++-----
>  src/util/virsystemd.c    |  6 ++---
>  tests/virpolkittest.c    | 24 +++++++++---------
>  8 files changed, 44 insertions(+), 68 deletions(-)

Reviewed-by: Daniel P. Berrangé <berrange at redhat.com>

Regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|




More information about the libvir-list mailing list