mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 14:15:28 +00:00
Remove bogus const return values in storage file APIs
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>
This commit is contained in:
parent
64212ed20e
commit
3f0010a673
@ -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;
|
||||
|
@ -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__ */
|
||||
|
Loading…
Reference in New Issue
Block a user