Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lxd/instance/drivers/lxc: detect if we need to remove a target direct…
…ory when unmounting When a disk device is removed while relying on a host directory and mapped to a target within a container, we detect if the target directory has been created by LXD or not in order to not delete the content of a target directory during the unmount. Example: - Let say we mounted a custom host empty directory (`test`) on the existing `/opt` directory of the container, when unmounted (`lxc device remove ...`), the target `/opt` won't be removed, because we marked it as NOT being created by LXD at mount time. - If, however, we created a custom empty target directory at mount time: `lxc config device add u1 test disk source=/home/user/test path=/new_dir`, the directory `new_dir` will be created on the target instance and if we decide to unmount `test`, the target `/new_dir` will be removed because is has been created by LXD Signed-off-by: Gabriel Mougard <[email protected]>
- Loading branch information