[parted-devel] [PATCH 2/2] dasd: enhance device probing

Brian C. Lane bcl at redhat.com
Tue Sep 15 18:46:26 UTC 2015


On Tue, Sep 15, 2015 at 03:02:55PM +0200, Hendrik Brueckner wrote:
> From: Viktor Mihajlovski <mihajlov at linux.vnet.ibm.com>
> 
> Probe for all device/transport types as every block device
> could be a DASD on s390.
> 
> Observe fdasd_get_geometry return code for proper error
> handling.
> 
> Remove the obsolete API check as we no longer require the
> DASD-specific IOCTLs.
> 
> We can't rely on PED_DEVICE_DASD to be set for non-native DASDs
> so we use a heuristic on s390x implemented in ped_device_like_dasd()

Does there need to be a distinction made between native and non-native?

If not, what I'd do is add ped_device_like_dasd as a static function to
arch/linux.c (something like _device_is_like_dasd), and call it from the
bottom else of _device_probe_type and set dev->type based on the check
when all else fails.

As you have it now you are exposing the function and we'd have to make
an API bump for it, and nothing outside is ever going to use it. So I'd
at least make it static so that it doesn't need to be exposed to
libparted users.

-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)



More information about the parted-devel mailing list