[PATCH 5/8] Reset default subvolume prior to removing the default subvolume.

Vratislav Podzimek vpodzime at redhat.com
Thu Sep 18 06:17:58 UTC 2014


On Tue, 2014-09-16 at 11:41 -0500, David Lehman wrote:
> Resolves: rhbz#1076383
> ---
>  blivet/devicelibs/btrfs.py |  7 +++++++
>  blivet/devices.py          | 21 +++++++++++++++++++++
>  2 files changed, 28 insertions(+)
> 
> diff --git a/blivet/devicelibs/btrfs.py b/blivet/devicelibs/btrfs.py
> index 0e1171d..94aefaa 100644
> --- a/blivet/devicelibs/btrfs.py
> +++ b/blivet/devicelibs/btrfs.py
> @@ -151,6 +151,13 @@ def get_default_subvolume(mountpoint):
>  
>      return default
>  
> +def set_default_subvolume(mountpoint, subvol_id):
> +    if not os.path.ismount(mountpoint):
> +        raise ValueError("volume not mounted")
> +
> +    args = ["subvol", "set-default", subvol_id, mountpoint]
> +    return btrfs(args)
> +
Adding this to a feature/function list of libblockdev.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list