All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Christian Borntraeger <borntraeger@de.ibm.com>
Cc: Jens Axboe <jens.axboe@oracle.com>,
	virtualization@lists.linux-foundation.org
Subject: Re: [PATCH] virtio_blk: provide getgeo
Date: Thu, 24 Jan 2008 09:06:47 +1100	[thread overview]
Message-ID: <200801240906.47658.rusty@rustcorp.com.au> (raw)
In-Reply-To: <200801231756.50224.borntraeger@de.ibm.com>

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.

      reply	other threads:[~2008-01-23 22:06 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-23 16:56 [PATCH] virtio_blk: provide getgeo Christian Borntraeger
2008-01-23 22:06 ` Rusty Russell [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200801240906.47658.rusty@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=borntraeger@de.ibm.com \
    --cc=jens.axboe@oracle.com \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.