[libvirt] [PATCH] debug: assure NULLSTR() around all %s args in debug at top of public APIs
Laine Stump
laine at laine.org
Thu May 28 19:09:04 UTC 2015
On 05/28/2015 05:58 AM, Martin Kletzander wrote:
> 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.
Somehow I knew that no matter how many times I looked through them all,
I would still miss one. Thanks for catching it!
>
> ACK with that fixed. I think this is safe for freeze, too.
Okay, I pushed this (and the previous patch).
More information about the libvir-list
mailing list