[parted-devel] [PATCH 0/2] parted: always print geometry

Jim Meyering jim at meyering.net
Fri Apr 16 19:50:38 UTC 2010


Petr Uzel wrote:

> These two patch series makes parted print disk geometry even if given disk does
> not contain valid partition table.
>
> Parted shipped with SUSE has similar patch for some time and one part
> of SUSE's installer (libstorage) depends on it.
>
> Please consider whether it is suitable for inclusion into upstream.
>
> Thanks,
>
> Petr Uzel (2):
>   parted: factor out disk geometry printing into separate function
>   parted: print disk geometry even if the disk does not have partition
>     table
>
>  parted/parted.c |   48 +++++++++++++++++++++++++++++-------------------
>  1 files changed, 29 insertions(+), 19 deletions(-)

Thanks for the patches.
Removing the unwarranted restriction is a welcome improvement.
However, having to document when the change takes effect is unpalatable,
because it doesn't make sense: why restrict it only to when we're using
units of archaic CHS or cylinders?
(sure, you and I know why, but that's an internal implementation detail)

Please change it so that it works regardless of which units are
selected.  It's fine to print "?" in place of the partition table
type name, when that is unknown.

A minor thing: since the new _print_disk_geometry doesn't write through
its "dev" parameter, that parameter should have the "const" attribute:

    static void
    _print_disk_geometry (PedDevice const *dev)

Also, please add a mention of this in NEWS, under "Changes in behavior".

It'd be great if you would add a test script that exercises
the new behavior, but if you'd rather not, I will do it.



More information about the parted-devel mailing list