[libvirt] [PATCH] API: Improve log for domain related APIs

Eric Blake eblake at redhat.com
Thu Dec 23 18:02:39 UTC 2010


On 12/23/2010 11:00 AM, Dave Allan wrote:
>>>  virConnectPtr
>>>  virDomainGetConnect (virDomainPtr dom)
>>>  {
>>> -    DEBUG("dom=%p", dom);
>>> +    const char *name = virDomainGetName(dom);
>>> +
>>> +    DEBUG("dom=%p, (VM: %s)", dom, name);
>>
>> virDomainGetName() can return NULL, so you'd need to use NULLSTR(name)
>> everywhere.  That alone requires a v2, but I'd wait for feedback from
>> danpb or DV as to whether this makes sense.
> 
> Whether what makes sense?

Do we risk any deadlocks by calling a public API (virDomainGetName) from
within the body of another public API (such as virDomainGetConnect)?  If
there is any risk, then the extra debug information is not worth it.
But if it's always safe to do, then I like the idea of the extra
information, even though it adds a slight amount of time to execute each
domain-related API.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20101223/4d3d0889/attachment-0001.sig>


More information about the libvir-list mailing list