[PATCH RFC 22/22] [DO NOT APPLY UPSTREAM] storage: gluster: mock up path canonicalization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add code to fake gluster storage path canonicalization while I'm working
on the code.
---
 src/storage/storage_backend_gluster.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/src/storage/storage_backend_gluster.c b/src/storage/storage_backend_gluster.c
index 1a844c9..411851b 100644
--- a/src/storage/storage_backend_gluster.c
+++ b/src/storage/storage_backend_gluster.c
@@ -533,6 +533,7 @@ typedef virStorageFileBackendGlusterPriv *virStorageFileBackendGlusterPrivPtr;

 struct _virStorageFileBackendGlusterPriv {
     glfs_t *vol;
+    char *uid;
 };


@@ -547,6 +548,7 @@ virStorageFileBackendGlusterDeinit(virStorageSourcePtr src)

     if (priv->vol)
         glfs_fini(priv->vol);
+    VIR_FREE(priv->uid);

     VIR_FREE(priv);
     src->drv->priv = NULL;
@@ -606,6 +608,10 @@ virStorageFileBackendGlusterInit(virStorageSourcePtr src)
         goto error;
     }

+    if (virAsprintf(&priv->uid, "gluster://%s:%d/%s/%s", hostname, port,
+                    src->volume, src->path) < 0)
+        goto error;
+
     src->drv->priv = priv;

     return 0;
@@ -713,6 +719,15 @@ virStorageFileBackendGlusterAccess(virStorageSourcePtr src,
 }


+static const char *
+virStorageFileBackendGlusterGetUniqueIdentifier(virStorageSourcePtr src)
+{
+    virStorageFileBackendGlusterPrivPtr priv = src->drv->priv;
+
+    return priv->uid;
+}
+
+
 virStorageFileBackend virStorageFileBackendGluster = {
     .type = VIR_STORAGE_TYPE_NETWORK,
     .protocol = VIR_STORAGE_NET_PROTOCOL_GLUSTER,
@@ -724,4 +739,8 @@ virStorageFileBackend virStorageFileBackendGluster = {
     .storageFileStat = virStorageFileBackendGlusterStat,
     .storageFileReadHeader = virStorageFileBackendGlusterReadHeader,
     .storageFileAccess = virStorageFileBackendGlusterAccess,
+
+    .storageFileGetUniqueIdentifier = virStorageFileBackendGlusterGetUniqueIdentifier,
+
+
 };
-- 
1.9.2

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]