[PATCH 2/2] lxc: Clean up /.oldroot

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

 



Remove the /.oldroot directory after it has been unmounted (at the end
of lxcContainerSetupPivotRoot). Ignore errors silently.

Signed-off-by: Radostin Stoyanov <rstoyanov1@xxxxxxxxx>
---
 src/lxc/lxc_container.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c
index 665b93a0a..dd4e38703 100644
--- a/src/lxc/lxc_container.c
+++ b/src/lxc/lxc_container.c
@@ -1811,6 +1811,9 @@ static int lxcContainerSetupPivotRoot(virDomainDefPtr vmDef,
     if (lxcContainerUnmountSubtree("/.oldroot", true) < 0)
         goto cleanup;
 
+    if (virFileRemove("/.oldroot", 0, 0) < 0)
+        VIR_DEBUG("Failed to remove /.oldroot after start");
+
     ret = 0;
 
  cleanup:
-- 
2.14.3

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

  Powered by Linux