[libvirt] [PATCH] storage: make debug log more useful

"__func__" should be replaced with "__FUNCTION__" instead for better portability, however, VIR_DEBUG already prints the function name, so it's useless, replace it with more useful log. * src/storage/storage_backend_mpath.c --- src/storage/storage_backend_mpath.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/storage/storage_backend_mpath.c b/src/storage/storage_backend_mpath.c index 2e85561..2d48a9d 100644 --- a/src/storage/storage_backend_mpath.c +++ b/src/storage/storage_backend_mpath.c @@ -316,7 +316,7 @@ virStorageBackendMpathRefreshPool(virConnectPtr conn ATTRIBUTE_UNUSED, { int retval = 0; - VIR_DEBUG("in %s", __func__); + VIR_DEBUG("conn=%p, pool=%p", conn, pool); pool->def->allocation = pool->def->capacity = pool->def->available = 0; -- 1.7.4

On 02/21/2011 12:08 AM, Osier Yang wrote:
"__func__" should be replaced with "__FUNCTION__" instead for better portability,
Actually, __FUNCTION__ is gcc-specific, while __func__ is the more portable C99 construct (we #define __FUNCTION__ __func__ in internal.h, and rely on the gnulib module for __func__, so either spelling works with equal portability from within libvirt; meanwhile, we should probably be gradually getting rid of __FUNCTION__).
however, VIR_DEBUG already prints the function name, so it's useless, replace it with more useful log.
* src/storage/storage_backend_mpath.c --- src/storage/storage_backend_mpath.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/storage/storage_backend_mpath.c b/src/storage/storage_backend_mpath.c index 2e85561..2d48a9d 100644 --- a/src/storage/storage_backend_mpath.c +++ b/src/storage/storage_backend_mpath.c @@ -316,7 +316,7 @@ virStorageBackendMpathRefreshPool(virConnectPtr conn ATTRIBUTE_UNUSED, { int retval = 0;
- VIR_DEBUG("in %s", __func__); + VIR_DEBUG("conn=%p, pool=%p", conn, pool);
ACK. -- Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org

于 2011年02月22日 06:23, Eric Blake 写道:
On 02/21/2011 12:08 AM, Osier Yang wrote:
"__func__" should be replaced with "__FUNCTION__" instead for better portability,
Actually, __FUNCTION__ is gcc-specific, while __func__ is the more portable C99 construct (we #define __FUNCTION__ __func__ in internal.h, and rely on the gnulib module for __func__, so either spelling works with equal portability from within libvirt; meanwhile, we should probably be gradually getting rid of __FUNCTION__).
good to known it, applied with discription updated.
however, VIR_DEBUG already prints the function name, so it's useless, replace it with more useful log.
* src/storage/storage_backend_mpath.c --- src/storage/storage_backend_mpath.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/storage/storage_backend_mpath.c b/src/storage/storage_backend_mpath.c index 2e85561..2d48a9d 100644 --- a/src/storage/storage_backend_mpath.c +++ b/src/storage/storage_backend_mpath.c @@ -316,7 +316,7 @@ virStorageBackendMpathRefreshPool(virConnectPtr conn ATTRIBUTE_UNUSED, { int retval = 0;
- VIR_DEBUG("in %s", __func__); + VIR_DEBUG("conn=%p, pool=%p", conn, pool);
ACK.
participants (2)
-
Eric Blake
-
Osier Yang