search for: is_partitioned_device

Displaying 10 results from an estimated 10 matches for "is_partitioned_device".

2018 Jan 22
0
[RFC PATCH v1 2/3] daemon: devsparts: add is_partitioned_device function
...15 insertions(+) diff --git a/daemon/devsparts.ml b/daemon/devsparts.ml index 54108bb..60ac11a 100644 --- a/daemon/devsparts.ml +++ b/daemon/devsparts.ml @@ -71,6 +71,20 @@ let list_devices () = map_block_devices ~return_md:false ((^) "/dev/") in sort_device_names devices +let is_partitioned_device device = + assert (String.is_prefix device "/dev/"); + assert (not (String.is_prefix device "/dev/mapper/")); + let device = String.sub device 5 (String.length device - 5) in + + (* Open the device's directory under /sys/block *) + let parts = Sys.readdir ("/sys/bl...
2018 Jan 25
0
[PATCH v2 2/3] daemon: list-filesystems: Don't list partitions which cannot hold file system.
..., 49 deletions(-) diff --git a/daemon/devsparts.ml b/daemon/devsparts.ml index 54108bb..42dc78d 100644 --- a/daemon/devsparts.ml +++ b/daemon/devsparts.ml @@ -71,6 +71,19 @@ let list_devices () = map_block_devices ~return_md:false ((^) "/dev/") in sort_device_names devices +let is_partitioned_device device = + assert (String.is_prefix device "/dev/"); + let device = String.sub device 5 (String.length device - 5) in + let dir = "/sys/block/" ^ device in + + try + (* Open the device's directory under /sys/block/<device> and + * look for entries starting w...
2018 Jan 23
2
Re: [RFC PATCH v1 3/3] daemon: list-filesystems: Don't list partitioned md devices
...Set.add (Devsparts.part_to_dev part) set > - ) StringSet.empty partitions in > - let devices = List.filter ( > - fun dev -> > - not (StringSet.mem dev devices_containing_partitions) > - ) devices in > + let device_without_partitions device = > + not (Devsparts.is_partitioned_device device) in > + > + let devices = Devsparts.list_devices () in > + let devices = List.filter device_without_partitions devices in > + let mds = Md.list_md_devices () in > + let mds = List.filter device_without_partitions mds in Yes, this is better than the previous approach with...
2018 Jan 22
8
[RFC] Inconsistent output of guestfs_list_filesystems
Before I rush to change something I request your comments on the subject. Let me know what do you think and if it does make sense. The issue: guesfs_list_filesystems is inconsistent in its output. For, example, it filters out partitioned physical devices but doesn't do the same for MD devices. More over, according to its name and API documentation guestfs_list_filesystem should return
2018 Apr 27
0
[PATCH v5 2/3] daemon: list-filesystems: Don't list partitions which cannot hold file system.
...Use vfs-type to check for filesystems on Windows dynamic disks. *) - ret @ - List.filter_map check_with_vfs_type ldmvols @ - List.filter_map check_with_vfs_type ldmparts + ret @ List.filter_map check_with_vfs_type ldmvols ) else ret in List.flatten ret +and is_partitioned_device device = + assert (String.is_prefix device "/dev/"); + let device = String.sub device 5 (String.length device - 5) in + let dir = "/sys/block/" ^ device in + + try + (* Open the device's directory under /sys/block/<device> and + * look for entries sta...
2018 Jan 28
9
guestfs_list_filesystems: skip block devices which cannot hold file system
Initial discussion is here: https://www.redhat.com/archives/libguestfs/2018-January/msg00188.html. v2 was posted here: https://www.redhat.com/archives/libguestfs/2018-January/msg00246.html. v3 comparing to v2 is just a rebase with slightly changed commits comments.
2018 Jan 25
2
[PATCH v2 1/3] daemon: Reimplement 'part_get_mbr_part_type' API in OCaml.
Instead of parsing 'parted' output OCaml implementation relies on the following facts: 1. The function is applicable for MBR partitions only (as noted in documentation and as function name suggests). 2. An attempt to call the function for non-MBR partition fails with "part_get_mbr_part_type can only be used on MBR Partitions" error and NULL is returned. 3. MBR partition table
2018 Jan 22
0
[RFC PATCH v1 3/3] daemon: list-filesystems: Don't list partitioned md devices
...fun set part -> - StringSet.add (Devsparts.part_to_dev part) set - ) StringSet.empty partitions in - let devices = List.filter ( - fun dev -> - not (StringSet.mem dev devices_containing_partitions) - ) devices in + let device_without_partitions device = + not (Devsparts.is_partitioned_device device) in + + let devices = Devsparts.list_devices () in + let devices = List.filter device_without_partitions devices in + let mds = Md.list_md_devices () in + let mds = List.filter device_without_partitions mds in (* Use vfs-type to check for filesystems on devices. *) let ret = List...
2018 Jan 23
0
Re: [RFC PATCH v1 3/3] daemon: list-filesystems: Don't list partitioned md devices
...ev part) set >> - ) StringSet.empty partitions in >> - let devices = List.filter ( >> - fun dev -> >> - not (StringSet.mem dev devices_containing_partitions) >> - ) devices in >> + let device_without_partitions device = >> + not (Devsparts.is_partitioned_device device) in >> + >> + let devices = Devsparts.list_devices () in >> + let devices = List.filter device_without_partitions devices in >> + let mds = Md.list_md_devices () in >> + let mds = List.filter device_without_partitions mds in > > Yes, this is better tha...
2018 Apr 27
4
[PATCH v5 0/3] libguestfs: guestfs_list_filesystems: skip block devices which cannot hold file system
This patch series: 1. Addresses comments from last review: part_get_mbr_part_type doesn't break original implementation in C. 2. Rebased on top of master and little bit refactored for readability. Mykola Ivanets (1): tests: md: Test guestfish list-filesystems command skips partitioned md devices. Nikolay Ivanets (2): daemon: Reimplement 'part_get_mbr_part_type' API in