Commit 9e302a8c authored by Iustin Pop's avatar Iustin Pop
Browse files

hv_chroot: move unmount to CleanupInstance()



This allows cleanup to be done properly if the "instance" wasn't running
at all (based on the CleanupInstance framework, instead of the retry in
hypervisor).
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 74a4c11b
......@@ -212,6 +212,13 @@ class ChrootManager(hv_base.BaseHypervisor):
raise HypervisorError("Can't stop the processes using the chroot")
return
def CleanupInstance(self, instance_name):
"""Cleanup after a stopped instance
"""
if self._IsDirLive(root_dir):
raise HypervisorError("Processes are still using the chroot")
for mpath in self._GetMountSubdirs(root_dir):
utils.RunCmd(["umount", mpath])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment