[PATCH v2 2/7] util: Added nfs params to virStorageSource

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

 



Signed-off-by: Ryan Gahagan <rgahagan@xxxxxxxxxxxxx>
---
 src/util/virstoragefile.c | 8 ++++++++
 src/util/virstoragefile.h | 8 ++++++++
 2 files changed, 16 insertions(+)

diff --git a/src/util/virstoragefile.c b/src/util/virstoragefile.c
index 1176630282..3097e11984 100644
--- a/src/util/virstoragefile.c
+++ b/src/util/virstoragefile.c
@@ -2293,6 +2293,11 @@ virStorageSourceCopy(const virStorageSource *src,
     def->ssh_host_key_check_disabled = src->ssh_host_key_check_disabled;
     def->ssh_user = g_strdup(src->ssh_user);
 
+    def->nfs_user = g_strdup(src->nfs_user);
+    def->nfs_group = g_strdup(src->nfs_group);
+    def->nfs_uid = src->nfs_uid;
+    def->nfs_gid = src->nfs_gid;
+
     return g_steal_pointer(&def);
 }
 
@@ -2533,6 +2538,9 @@ virStorageSourceClear(virStorageSourcePtr def)
 
     VIR_FREE(def->ssh_user);
 
+    VIR_FREE(def->nfs_user);
+    VIR_FREE(def->nfs_group);
+
     virStorageSourceInitiatorClear(&def->initiator);
 
     /* clear everything except the class header as the object APIs
diff --git a/src/util/virstoragefile.h b/src/util/virstoragefile.h
index e1fbbafe26..47d901a478 100644
--- a/src/util/virstoragefile.h
+++ b/src/util/virstoragefile.h
@@ -385,6 +385,14 @@ struct _virStorageSource {
     /* these must not be used apart from formatting the output JSON in the qemu driver */
     char *ssh_user;
     bool ssh_host_key_check_disabled;
+
+    /* nfs_user and nfs_group store the strings passed in by the user for NFS params.
+     * nfs_uid and nfs_gid represent the converted/looked up ID numbers which are used
+     * during run time, and are not based on the configuration */
+    char *nfs_user;
+    char *nfs_group;
+    uid_t nfs_uid;
+    gid_t nfs_gid;
 };
 
 G_DEFINE_AUTOPTR_CLEANUP_FUNC(virStorageSource, virObjectUnref);
-- 
2.29.2




[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]

  Powered by Linux