[parted-devel] [PATCH 1/2] fdasd: geometry handling updated from upstream s390-tools
Brian C. Lane
bcl at redhat.com
Tue Sep 15 18:01:36 UTC 2015
On Tue, Sep 15, 2015 at 03:02:54PM +0200, Hendrik Brueckner wrote:
> From: Viktor Mihajlovski <mihajlov at linux.vnet.ibm.com>
>
> Remove the necessity for DASD-specific ioctls for partition handling.
> This allows to correctly handle DASD-backed virtio block devices.
I'm still not sure what the benefit of this is for the VM. Why not use
the normal virtio devices?
> +/* kl: key length, dl: data length */
> +static unsigned int recs_per_track(unsigned short dev_type, unsigned int kl,
> + unsigned int dl)
> +{
> + int dn, kn;
These should be unsigned int since that's what ceil_quot returns.
> } else {
> + if (ioctl(f, BLKGETSIZE64, &size_in_bytes) != 0) {
> + fdasd_error(anc, unable_to_ioctl,
> + "Could not retrieve disk size.");
> + }
This should be a translated string. Also, does it need more error
handling? I see that most of the fdasd_error calls currently fall
through without doing anything special and I'm not sure how correct that
is.
> + if (ioctl(f, BIODASDINFO, &dasd_info) != 0) {
> + /* verify that the geometry matches a 3390 DASD */
> + if (!fdasd_verify_geometry(DASD_3390_TYPE, blksize,
> + &anc->geo)) {
> + fdasd_error(anc, wrong_disk_type,
> + "Disk geometry does not match a "
> + "DASD device of type 3390.");
> + goto error;
This should also be a translated string.
--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
More information about the parted-devel
mailing list