]> xenbits.xensource.com Git - libvirt.git/commitdiff
virLockManagerSanlockAddResource: Do not ignore unknown resource types
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 22 Aug 2018 09:59:45 +0000 (11:59 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 5 Sep 2018 08:58:56 +0000 (10:58 +0200)
Currently, there are only two types of resource. So effectively
this is a dead code. However, that assumption can change and we
shouldn't just silently ignore the error.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/locking/lock_driver_sanlock.c

index 3e5f0e37b05ab359b203bd2a022f1bc3c932cb49..39c2f94a76a9c1ed5929095501e7853dd9f95e14 100644 (file)
@@ -829,8 +829,10 @@ static int virLockManagerSanlockAddResource(virLockManagerPtr lock,
         break;
 
     default:
-        /* Ignore other resources, without error */
-        break;
+        virReportError(VIR_ERR_INTERNAL_ERROR,
+                       _("Unknown lock manager object type %d for domain lock object"),
+                       type);
+        return -1;
     }
 
     return 0;