[libvirt] [PATCH 1/3] storage: backend: Use correct stringifier for pool type

Peter Krempa posted 3 patches 8 years, 10 months ago
[libvirt] [PATCH 1/3] storage: backend: Use correct stringifier for pool type
Posted by Peter Krempa 8 years, 10 months ago
When registering a storage poll backend, the code would use
virStorageTypeToString instead of virStoragePoolTypeToString. The
following message would be logged:

virDriverLoadModuleFunc:71 : Lookup function 'virStorageBackendSCSIRegister'
virStorageBackendRegister:174 : Registering storage backend '(null)'
---
 src/storage/storage_backend.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
index ce278b99c..7f892df7e 100644
--- a/src/storage/storage_backend.c
+++ b/src/storage/storage_backend.c
@@ -171,7 +171,7 @@ int
 virStorageBackendRegister(virStorageBackendPtr backend)
 {
     VIR_DEBUG("Registering storage backend '%s'",
-              virStorageTypeToString(backend->type));
+              NULLSTR(virStoragePoolTypeToString(backend->type)));

     if (virStorageBackendsCount >= VIR_STORAGE_BACKENDS_MAX) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-- 
2.12.1

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 1/3] storage: backend: Use correct stringifier for pool type
Posted by Erik Skultety 8 years, 10 months ago
On Thu, Mar 30, 2017 at 02:03:45PM +0200, Peter Krempa wrote:
> When registering a storage poll backend, the code would use
> virStorageTypeToString instead of virStoragePoolTypeToString. The
> following message would be logged:
>
> virDriverLoadModuleFunc:71 : Lookup function 'virStorageBackendSCSIRegister'
> virStorageBackendRegister:174 : Registering storage backend '(null)'
> ---
>  src/storage/storage_backend.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/storage/storage_backend.c b/src/storage/storage_backend.c
> index ce278b99c..7f892df7e 100644
> --- a/src/storage/storage_backend.c
> +++ b/src/storage/storage_backend.c
> @@ -171,7 +171,7 @@ int
>  virStorageBackendRegister(virStorageBackendPtr backend)
>  {
>      VIR_DEBUG("Registering storage backend '%s'",
> -              virStorageTypeToString(backend->type));
> +              NULLSTR(virStoragePoolTypeToString(backend->type)));

The NULLSTR is unnecessary, since this is only being called from the backends
themselves and each backend sets the its type appropriately.

>
>      if (virStorageBackendsCount >= VIR_STORAGE_BACKENDS_MAX) {
>          virReportError(VIR_ERR_INTERNAL_ERROR,

^This virReportError also uses the incorrect stringifier and needs to be fixed.

ACK with adjustments.

Erik

> --
> 2.12.1
>
> --
> libvir-list mailing list
> libvir-list@redhat.com
> https://www.redhat.com/mailman/listinfo/libvir-list

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list