[Kimchi-devel] [project-kimchi] [PATCH 2/3] Issue #276: logical pool: a quick fix for the device listing rules, back-end

Crístian Viana vianac at linux.vnet.ibm.com
Wed Dec 18 19:41:31 UTC 2013


Reviewed-by: Crístian Viana <vianac at linux.vnet.ibm.com>

On 18-12-2013 15:22, Aline Manera wrote:
> From: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
>
> The current logical pool implementation has some problems. It lists ext4
> patitions but in fact partitions with FS should not be listed, because
> a dual boot system setup can make use of those unmounted partitions. It
> also fails to run lsblk for some devices.
>
> According to the discussion on github issue page[1]. We decide to list
> only unused partitions and disks, which means, PV and LV will not be
> listed, mounted partitions and partition with FS will not be listed.
>
> When lsblk fails to run on a purticular device, it swallows the error
> and return an empty dict.
>
> Some kinds of free block device still can not be listed by the current
> quick fix, for this is only a *quick* fix. The following cases are not
> covered, they should be improved in future patches.
> 1. PV that doesn't belong to any VG.
>    blkid and lsblk do not provide enough information to detect if a PV
>    belongs to an VG.
>
> To get the device path, it uses sysfs uevent file to get the device name and
> then assume the device path is /dev/<devname>
>
> This patch also drops the defensive coding style of the current
> implementation. Defensive coding is not Pythonic. It makes the code
> harder to debug, delay the discovery of code error and makes the main
> logic unclear. This patch also extract a function to run and parse
> lsblk to avoid repeating similar code.
>
> For a long term solution, backend should just list all block devices,
> along with information describing if they are in use. The front end
> provides a checkbox "filter in use devices" and let users decide what
> they want.
>
> [1] https://github.com/kimchi-project/kimchi/issues/276
>
> Signed-off-by: Zhou Zheng Sheng <zhshzhou at linux.vnet.ibm.com>
> Signed-off-by: Aline Manera <alinefm at br.ibm.com>
>
> fix

-- 
project-kimchi mailing list <project-kimchi at googlegroups.com>
https://groups.google.com/forum/#!forum/project-kimchi
--- 
You received this message because you are subscribed to the Google Groups "project-kimchi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to project-kimchi+unsubscribe at googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



More information about the Kimchi-devel mailing list