[libvirt] [PATCH v2 05/14] hyperv: handle missing switch enum cases

Daniel P. Berrangé posted 14 patches 7 years, 2 months ago
[libvirt] [PATCH v2 05/14] hyperv: handle missing switch enum cases
Posted by Daniel P. Berrangé 7 years, 2 months ago
Ensure all enum cases are listed in switch statements. This improves
debug logging integration with openwsman.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 src/hyperv/hyperv_driver.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/hyperv/hyperv_driver.c b/src/hyperv/hyperv_driver.c
index ee94fd3511..e512b626ea 100644
--- a/src/hyperv/hyperv_driver.c
+++ b/src/hyperv/hyperv_driver.c
@@ -1656,13 +1656,27 @@ hypervDebugHandler(const char *message, debug_level_e level,
     switch (level) {
       case DEBUG_LEVEL_ERROR:
       case DEBUG_LEVEL_CRITICAL:
-        VIR_ERROR(_("openwsman error: %s"), message);
+      case DEBUG_LEVEL_ALWAYS:
+        VIR_ERROR(_("openwsman: %s"), message);
         break;
 
       case DEBUG_LEVEL_WARNING:
-        VIR_WARN("openwsman warning: %s", message);
+        VIR_WARN("openwsman: %s", message);
         break;
 
+      case DEBUG_LEVEL_MESSAGE:
+        VIR_INFO("openwsman: %s", message);
+        break;
+
+      case DEBUG_LEVEL_INFO:
+        VIR_INFO("openwsman: %s", message);
+        break;
+
+      case DEBUG_LEVEL_DEBUG:
+        VIR_DEBUG("openwsman: %s", message);
+        break;
+
+      case DEBUG_LEVEL_NONE:
       default:
         /* Ignore the rest */
         break;
-- 
2.14.3

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v2 05/14] hyperv: handle missing switch enum cases
Posted by John Ferlan 7 years, 2 months ago

On 02/20/2018 12:08 PM, Daniel P. Berrangé wrote:
> Ensure all enum cases are listed in switch statements. This improves
> debug logging integration with openwsman.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
> ---
>  src/hyperv/hyperv_driver.c | 18 ++++++++++++++++--
>  1 file changed, 16 insertions(+), 2 deletions(-)
> 

Reviewed-by: John Ferlan <jferlan@redhat.com>

John

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