[rhinstaller/blivet/pulls/114 master] Use COW device to get actual size of LVM snapshots
vpodzime
installerbot-noreply at redhat.com
Thu May 14 06:57:12 UTC 2015
> @@ -226,6 +226,18 @@ def get_sysfs_path_by_name(dev_node, class_name="block"):
> raise RuntimeError("get_sysfs_path_by_name: Could not find sysfs path "
> "for '%s' (it is not at '%s')" % (dev_node, dev_path))
>
> +def get_cow_sysfs_path(dev_path, dev_sysfsPath):
> + """ Return sysfs path of cow device for a given lvm snapshot.
> + """
> +
> + cow_path = dev_path + "-cow"
> + if not os.path.islink(cow_path):
> + raise RuntimeError("get_cow_sysfs_path: Could not find cow device for" %
> + (dev_path))
> +
> + dm_name = os.path.basename(os.path.realpath(cow_path))
> + return os.path.join(os.path.split(dev_sysfsPath)[0], dm_name)
I think these two lines are worth a comment about what's going on there as I find them quite cryptic.
--
To view this pull request on github, visit https://github.com/rhinstaller/blivet/pull/114#discussion_r30301453
More information about the anaconda-patches
mailing list