]> xenbits.xensource.com Git - libvirt.git/commitdiff
Add missing "%s" format string to constant error messages in lock manager
authorJiri Denemark <jdenemar@redhat.com>
Fri, 20 Jul 2012 12:10:50 +0000 (13:10 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Fri, 20 Jul 2012 12:18:47 +0000 (13:18 +0100)
Updates the lock manager code so that it passes "%s" as the format
string whenever raising an error message with a const string.

src/locking/lock_driver_sanlock.c

index 40cd518d51b1fbabac2eecf5b4a6af60d0d3a996..477c80b4d6b29676ae8d2949fbd8c069ecaa5a87 100644 (file)
@@ -296,7 +296,7 @@ static int virLockManagerSanlockInit(unsigned int version,
         goto error;
 
     if (driver->autoDiskLease && !driver->hostID) {
-        virLockError(VIR_ERR_INTERNAL_ERROR,
+        virLockError(VIR_ERR_INTERNAL_ERROR, "%s",
                      _("Automatic disk lease mode enabled, but no host ID is set"));
         goto error;
     }
@@ -338,7 +338,7 @@ static int virLockManagerSanlockNew(virLockManagerPtr lock,
     virCheckFlags(0, -1);
 
     if (!driver) {
-        virLockError(VIR_ERR_INTERNAL_ERROR,
+        virLockError(VIR_ERR_INTERNAL_ERROR, "%s",
                      _("Sanlock plugin is not initialized"));
         return -1;
     }
@@ -409,13 +409,13 @@ static int virLockManagerSanlockDiskLeaseName(const char *path,
     int i;
 
     if (strbuflen < ((MD5_DIGEST_SIZE * 2) + 1)) {
-        virLockError(VIR_ERR_INTERNAL_ERROR,
+        virLockError(VIR_ERR_INTERNAL_ERROR, "%s",
                      _("String length too small to store md5 checksum"));
         return -1;
     }
 
     if (!(md5_buffer(path, strlen(path), buf))) {
-        virLockError(VIR_ERR_INTERNAL_ERROR,
+        virLockError(VIR_ERR_INTERNAL_ERROR, "%s",
                      _("Unable to compute md5 checksum"));
         return -1;
     }
@@ -499,7 +499,7 @@ static int virLockManagerSanlockAddDisk(virLockManagerPtr lock,
     char *path = NULL;
 
     if (nparams) {
-        virLockError(VIR_ERR_INTERNAL_ERROR,
+        virLockError(VIR_ERR_INTERNAL_ERROR, "%s",
                      _("Unexpected lock parameters for disk resource"));
         return -1;
     }