[libvirt PATCHv1 5/8] qemu: format uid/gid map for virtiofs

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

 



Pass the ID map to virtiofsd.

https://bugzilla.redhat.com/show_bug.cgi?id=2034630
https://gitlab.com/libvirt/libvirt/-/issues/535

Signed-off-by: Ján Tomko <jtomko@xxxxxxxxxx>
---
 src/qemu/qemu_virtiofs.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/qemu/qemu_virtiofs.c b/src/qemu/qemu_virtiofs.c
index 230f85c291..94c8b4711e 100644
--- a/src/qemu/qemu_virtiofs.c
+++ b/src/qemu/qemu_virtiofs.c
@@ -169,6 +169,19 @@ qemuVirtioFSBuildCommandLine(virQEMUDriverConfig *cfg,
     if (cfg->virtiofsdDebug)
         virCommandAddArg(cmd, "-d");
 
+    if (fs->idmap.nuidmap > 0) {
+        virCommandAddArgFormat(cmd, "--uid-map=:%u:%u:%u:",
+                               fs->idmap.uidmap[0].start,
+                               fs->idmap.uidmap[0].target,
+                               fs->idmap.uidmap[0].count);
+    }
+    if (fs->idmap.ngidmap > 0) {
+        virCommandAddArgFormat(cmd, "--gid-map=:%u:%u:%u:",
+                               fs->idmap.gidmap[0].start,
+                               fs->idmap.gidmap[0].target,
+                               fs->idmap.gidmap[0].count);
+    }
+
     return g_steal_pointer(&cmd);
 }
 
-- 
2.41.0




[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