Re: [PATCH] virtio_blk: provide getgeo

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thursday 24 January 2008 03:56:50 Christian Borntraeger wrote:
> Rusty,
>
> I currently try to make my guest boot from an virtio root device
> without having an external kernel. Some of the tools that I tried
> expect HDIO_GETGEO to work. The most interesting value is likely
> the geo.start value to get the offset of a partition. This value
> is filled by block/ioctl.c if fops->getgeo is set. This patch also
> fills in some standard values for heads, sectors and cylinders.
>
> Makes sense?

Perfect sense, applied.

I wonder if there's a standard helper for this?

> +/* We provide getgeo only to please some old bootloader/partitioning tools
> */ +static int virtblk_getgeo(struct block_device *bd, struct hd_geometry
> *geo) +{
> +	/* some standard values, similar to sd */
> +	geo->heads = 1 << 6;
> +	geo->sectors = 1 << 5;
> +	geo->cylinders = get_capacity(bd->bd_disk) >> 11;
> +	return 0;
> +}

Thanks,
Rusty.
_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linux-foundation.org/mailman/listinfo/virtualization

[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux