[libvirt] [PATCH] debug: assure NULLSTR() around all %s args in debug at top of public APIs

Martin Kletzander mkletzan at redhat.com
Thu May 28 09:58:49 UTC 2015


On Wed, May 27, 2015 at 02:02:53PM -0400, Laine Stump wrote:
>There are also a couple that were very uninformatively just logging
>the value of the pointer rather than the string itself:
>
>* the "name" arg to virNodeDeviceLookupByName()
>* wwnn and wwpn args to virNodeDeviceLookupSCSIHostByWWN()
>
>All char*'s that make sense should now have their contents logged
>rather than the pointer, and all %s args should now be inside
>NULLSTR().
>---
> src/libvirt-domain.c    | 36 ++++++++++++++++++------------------
> src/libvirt-host.c      |  6 +++---
> src/libvirt-interface.c |  6 +++---
> src/libvirt-network.c   |  6 +++---
> src/libvirt-nodedev.c   | 10 +++++-----
> src/libvirt-nwfilter.c  |  6 +++---
> src/libvirt-secret.c    |  4 ++--
> src/libvirt-storage.c   | 16 ++++++++--------
> 8 files changed, 45 insertions(+), 45 deletions(-)
>
>diff --git a/src/libvirt-domain.c b/src/libvirt-domain.c
>index 2edba1a..5907f58 100644
>--- a/src/libvirt-domain.c
>+++ b/src/libvirt-domain.c
>@@ -4817,7 +4817,7 @@ virDomainMigratePrepare3(virConnectPtr dconn,
>     VIR_DEBUG("dconn=%p, cookiein=%p, cookieinlen=%d, cookieout=%p, "
>               "cookieoutlen=%p, uri_in=%s, uri_out=%p, flags=%lx, dname=%s, "
>               "bandwidth=%lu, dom_xml=%s",
>-              dconn, cookiein, cookieinlen, cookieout, cookieoutlen, uri_in,
>+              dconn, cookiein, cookieinlen, cookieout, cookieoutlen, NULLSTR(uri_in),
>               uri_out, flags, NULLSTR(dname), bandwidth, dom_xml);

You missed dom_xml here.

ACK with that fixed.  I think this is safe for freeze, too.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20150528/9f87a4dd/attachment-0001.sig>


More information about the libvir-list mailing list