]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Revert "qemu: Temporary disable owner remembering"
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 15 Jan 2019 08:50:58 +0000 (09:50 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 3 Jul 2019 06:36:04 +0000 (08:36 +0200)
This reverts commit fc3990c7e64be1da1631952d3ec384ebef50e125.

Now that all the reported bugs are fixed let's turn the feature
back on.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Cole Robinson <crobinso@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
docs/news.xml
src/qemu/libvirtd_qemu.aug
src/qemu/qemu.conf
src/qemu/qemu_conf.c
src/qemu/test_libvirtd_qemu.aug.in

index e78c7ef98242626b6433be5f88c158e0afadbd16..ca1180d3d8c7bcfa89f05d73ed33263694afac25 100644 (file)
     <section title="New features">
     </section>
     <section title="Improvements">
+      <change>
+        <summary>
+          Remember original owners and SELinux labels of files
+        </summary>
+        <description>
+          When a domain is starting up libvirt changes DAC and
+          SELinux labels so that domain can access it. However,
+          it never remembered the original labels and therefore
+          the file was returned back to <code>root:root</code>.
+          With this release, the original labels are remembered
+          and restored properly.
+        </description>
+      </change>
     </section>
     <section title="Bug fixes">
     </section>
index 6821cc4a2922b643757dd7fb335c56656c1cdcfd..eea9094d39406b8bc410ebdaf826df46a631678f 100644 (file)
@@ -72,6 +72,7 @@ module Libvirtd_qemu =
                  | str_entry "user"
                  | str_entry "group"
                  | bool_entry "dynamic_ownership"
+                 | bool_entry "remember_owner"
                  | str_array_entry "cgroup_controllers"
                  | str_array_entry "cgroup_device_acl"
                  | int_entry "seccomp_sandbox"
index 1969b3f0a1d4b675a484c60bc2c2dc41ec02ba9f..fd2ed9dc219b3a310dda530d29708eb45aaa0838 100644 (file)
 # Set to 0 to disable file ownership changes.
 #dynamic_ownership = 1
 
+# Whether libvirt should remember and restore the original
+# ownership over files it is relabeling. Defaults to 1, set
+# to 0 to disable the feature.
+#remember_owner = 1
+
 # What cgroup controllers to make use of with QEMU guests
 #
 #  - 'cpu' - use for scheduler tunables
index 8312f99f80166160e2edc51573b96e48e490aa90..e0195dac296541037bc77ea65c349a06cc5498bc 100644 (file)
@@ -125,6 +125,7 @@ virQEMUDriverConfigPtr virQEMUDriverConfigNew(bool privileged)
         cfg->group = (gid_t)-1;
     }
     cfg->dynamicOwnership = privileged;
+    cfg->rememberOwner = privileged;
 
     cfg->cgroupControllers = -1; /* -1 == auto-detect */
 
@@ -890,6 +891,9 @@ virQEMUDriverConfigLoadSecurityEntry(virQEMUDriverConfigPtr cfg,
     if (virConfGetValueBool(conf, "dynamic_ownership", &cfg->dynamicOwnership) < 0)
         return -1;
 
+    if (virConfGetValueBool(conf, "remember_owner", &cfg->rememberOwner) < 0)
+        return -1;
+
     if (virConfGetValueStringList(conf, "cgroup_controllers", false,
                                   &controllers) < 0)
         return -1;
index 50b728ad2281f73fa89768ecb518df66d9e56156..388ba24b8bea6fd2b6cdfdd85928f6eaad4e298b 100644 (file)
@@ -44,6 +44,7 @@ module Test_libvirtd_qemu =
 { "user" = "root" }
 { "group" = "root" }
 { "dynamic_ownership" = "1" }
+{ "remember_owner" = "1" }
 { "cgroup_controllers"
     { "1" = "cpu" }
     { "2" = "devices" }