]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Remove bogus const return values in storage file APIs
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 11 Dec 2012 16:39:00 +0000 (16:39 +0000)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 12 Dec 2012 10:50:55 +0000 (10:50 +0000)
virStorageFileGetLVMKey and virStorageFileGetSCSIKey
both return heap allocated strings, so the return value
should not be marked const.

Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
src/util/storage_file.c
src/util/storage_file.h

index 44174047013bb885d5bd368ed8b3cc9e3b84ac91..17a47cf02684c05ea844e6b1fb53afd99eb51b57 100644 (file)
@@ -1192,7 +1192,7 @@ int virStorageFileIsClusterFS(const char *path)
 }
 
 #ifdef LVS
-const char *virStorageFileGetLVMKey(const char *path)
+char *virStorageFileGetLVMKey(const char *path)
 {
     /*
      *  # lvs --noheadings --unbuffered --nosuffix --options "uuid" LVNAME
@@ -1237,7 +1237,7 @@ cleanup:
     return key;
 }
 #else
-const char *virStorageFileGetLVMKey(const char *path)
+char *virStorageFileGetLVMKey(const char *path)
 {
     virReportSystemError(ENOSYS, _("Unable to get LVM key for %s"), path);
     return NULL;
@@ -1245,7 +1245,7 @@ const char *virStorageFileGetLVMKey(const char *path)
 #endif
 
 #ifdef HAVE_UDEV
-const char *virStorageFileGetSCSIKey(const char *path)
+char *virStorageFileGetSCSIKey(const char *path)
 {
     char *key = NULL;
     virCommandPtr cmd = virCommandNewArgList(
@@ -1275,7 +1275,7 @@ cleanup:
     return key;
 }
 #else
-const char *virStorageFileGetSCSIKey(const char *path)
+char *virStorageFileGetSCSIKey(const char *path)
 {
     virReportSystemError(ENOSYS, _("Unable to get SCSI key for %s"), path);
     return NULL;
index abfaca96bc95a8dc2cc7a4271452a3ddabd87209..9e4516e0dca09dfdee74f8daf63f8862e5767376 100644 (file)
@@ -101,7 +101,7 @@ int virStorageFileIsClusterFS(const char *path);
 int virStorageFileIsSharedFSType(const char *path,
                                  int fstypes);
 
-const char *virStorageFileGetLVMKey(const char *path);
-const char *virStorageFileGetSCSIKey(const char *path);
+char *virStorageFileGetLVMKey(const char *path);
+char *virStorageFileGetSCSIKey(const char *path);
 
 #endif /* __VIR_STORAGE_FILE_H__ */