[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

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



On 12/23/2010 06:53 AM, Osier Yang wrote:
> Add VM name/UUID in log for domain related APIs.
> Format: "param0=%p, param1=%p, (VM: %s)"
> 
> * src/libvirt.c
> ---
>  src/libvirt.c |  294 +++++++++++++++++++++++++++++++++++++++++++--------------
>  1 files changed, 221 insertions(+), 73 deletions(-)
> 
> diff --git a/src/libvirt.c b/src/libvirt.c
> index ee2495a..03dcafc 100644
> --- a/src/libvirt.c
> +++ b/src/libvirt.c
> @@ -1961,7 +1961,9 @@ error:
>  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.

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

Attachment: signature.asc
Description: OpenPGP digital signature


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]