Re: [PATCH 03/39] Remove virStorageSourceGetUniqueIdentifier file backend API

2021-04-07 Thread Ján Tomko

On a Thursday in 2021, Peter Krempa wrote:

The API isn't used any more.

Signed-off-by: Peter Krempa 
---
src/libvirt_private.syms  |  1 -
src/storage_file/storage_file_backend.h   |  4 --
src/storage_file/storage_file_backend_fs.c| 24 ---
.../storage_file_backend_gluster.c| 71 ---
src/storage_file/storage_source.c | 37 +-
5 files changed, 1 insertion(+), 136 deletions(-)



This one can be deleted too:
src/storage_file/storage_source.h=110=const char *
src/storage_file/storage_source.h:111:virStorageSourceGetUniqueIdentifier(virStorageSourcePtr
 src);

Reviewed-by: Ján Tomko 

Jano


signature.asc
Description: PGP signature


[PATCH 03/39] Remove virStorageSourceGetUniqueIdentifier file backend API

2021-04-01 Thread Peter Krempa
The API isn't used any more.

Signed-off-by: Peter Krempa 
---
 src/libvirt_private.syms  |  1 -
 src/storage_file/storage_file_backend.h   |  4 --
 src/storage_file/storage_file_backend_fs.c| 24 ---
 .../storage_file_backend_gluster.c| 71 ---
 src/storage_file/storage_source.c | 37 +-
 5 files changed, 1 insertion(+), 136 deletions(-)

diff --git a/src/libvirt_private.syms b/src/libvirt_private.syms
index cb9fe7c80a..62ccda467f 100644
--- a/src/libvirt_private.syms
+++ b/src/libvirt_private.syms
@@ -1713,7 +1713,6 @@ virStorageSourceGetMetadata;
 virStorageSourceGetMetadataFromBuf;
 virStorageSourceGetMetadataFromFD;
 virStorageSourceGetRelativeBackingPath;
-virStorageSourceGetUniqueIdentifier;
 virStorageSourceInit;
 virStorageSourceInitAs;
 virStorageSourceNewFromBacking;
diff --git a/src/storage_file/storage_file_backend.h 
b/src/storage_file/storage_file_backend.h
index ecf5883a55..8ad579a8db 100644
--- a/src/storage_file/storage_file_backend.h
+++ b/src/storage_file/storage_file_backend.h
@@ -60,9 +60,6 @@ typedef ssize_t
  size_t len,
  char **buf);

-typedef const char *
-(*virStorageFileBackendGetUniqueIdentifier)(virStorageSourcePtr src);
-
 typedef int
 (*virStorageFileBackendAccess)(virStorageSourcePtr src,
int mode);
@@ -88,7 +85,6 @@ struct _virStorageFileBackend {
 virStorageFileBackendInit backendInit;
 virStorageFileBackendDeinit backendDeinit;
 virStorageFileBackendRead storageFileRead;
-virStorageFileBackendGetUniqueIdentifier storageFileGetUniqueIdentifier;

 /* The following group of callbacks is expected to set errno
  * and return -1 on error. No libvirt error shall be reported */
diff --git a/src/storage_file/storage_file_backend_fs.c 
b/src/storage_file/storage_file_backend_fs.c
index 7b114fdeb0..f34ffd5fc8 100644
--- a/src/storage_file/storage_file_backend_fs.c
+++ b/src/storage_file/storage_file_backend_fs.c
@@ -147,24 +147,6 @@ virStorageFileBackendFileRead(virStorageSourcePtr src,
 }


-static const char *
-virStorageFileBackendFileGetUniqueIdentifier(virStorageSourcePtr src)
-{
-virStorageDriverDataPtr drv = src->drv;
-virStorageFileBackendFsPrivPtr priv = drv->priv;
-
-if (!priv->canonpath) {
-if (!(priv->canonpath = virFileCanonicalizePath(src->path))) {
-virReportSystemError(errno, _("can't canonicalize path '%s'"),
- src->path);
-return NULL;
-}
-}
-
-return priv->canonpath;
-}
-
-
 static int
 virStorageFileBackendFileAccess(virStorageSourcePtr src,
 int mode)
@@ -197,8 +179,6 @@ virStorageFileBackend virStorageFileBackendFile = {
 .storageFileRead = virStorageFileBackendFileRead,
 .storageFileAccess = virStorageFileBackendFileAccess,
 .storageFileChown = virStorageFileBackendFileChown,
-
-.storageFileGetUniqueIdentifier = 
virStorageFileBackendFileGetUniqueIdentifier,
 };


@@ -212,8 +192,6 @@ virStorageFileBackend virStorageFileBackendBlock = {
 .storageFileRead = virStorageFileBackendFileRead,
 .storageFileAccess = virStorageFileBackendFileAccess,
 .storageFileChown = virStorageFileBackendFileChown,
-
-.storageFileGetUniqueIdentifier = 
virStorageFileBackendFileGetUniqueIdentifier,
 };


@@ -225,8 +203,6 @@ virStorageFileBackend virStorageFileBackendDir = {

 .storageFileAccess = virStorageFileBackendFileAccess,
 .storageFileChown = virStorageFileBackendFileChown,
-
-.storageFileGetUniqueIdentifier = 
virStorageFileBackendFileGetUniqueIdentifier,
 };


diff --git a/src/storage_file/storage_file_backend_gluster.c 
b/src/storage_file/storage_file_backend_gluster.c
index 06ba99bfe3..252eb523af 100644
--- a/src/storage_file/storage_file_backend_gluster.c
+++ b/src/storage_file/storage_file_backend_gluster.c
@@ -255,75 +255,6 @@ virStorageFileBackendGlusterAccess(virStorageSourcePtr src,
 return glfs_access(priv->vol, src->path, mode);
 }

-static int
-virStorageFileBackendGlusterReadlinkCallback(const char *path,
- char **linkpath,
- void *data)
-{
-virStorageFileBackendGlusterPrivPtr priv = data;
-size_t bufsiz = 0;
-ssize_t ret;
-struct stat st;
-g_autofree char *buf = NULL;
-
-*linkpath = NULL;
-
-if (glfs_stat(priv->vol, path, ) < 0) {
-virReportSystemError(errno,
- _("failed to stat gluster path '%s'"),
- path);
-return -1;
-}
-
-if (!S_ISLNK(st.st_mode))
-return 1;
-
- realloc:
-VIR_EXPAND_N(buf, bufsiz, 256);
-
-if ((ret = glfs_readlink(priv->vol, path, buf, bufsiz)) < 0) {
-virReportSystemError(errno,
- _("failed to read link of gluster file '%s'"),
-