All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Stefan Bader <stefan.bader@canonical.com>
Cc: xen-devel@lists.xensource.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH 3/3] xen-blkfront: Fix minor offset calculation for emulated IDE disks
Date: Tue, 19 Jul 2011 09:22:59 -0400	[thread overview]
Message-ID: <20110719132259.GA5191@dumpdata.com> (raw)
In-Reply-To: <1310650247-7366-1-git-send-email-stefan.bader@canonical.com>

On Thu, Jul 14, 2011 at 03:30:47PM +0200, Stefan Bader wrote:
> Before this a block device defined as hda1 in the configuration files
> would be mapped to hda, as well as hda2.

Pulled patch 1,2, and dropped this one.

> 
> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
> ---
>  drivers/block/xen-blkfront.c |   12 +++++++-----
>  1 files changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
> index 6e46edb..77489f1 100644
> --- a/drivers/block/xen-blkfront.c
> +++ b/drivers/block/xen-blkfront.c
> @@ -449,15 +449,17 @@ static int xen_translate_vdev(int vdevice, int *minor, unsigned int *offset)
>  	major = BLKIF_MAJOR(vdevice);
>  	*minor = BLKIF_MINOR(vdevice);
>  	switch (major) {
> +		/* For IDE the assumption seems to be 64 partitions (including
> +		 * the whole device) per disk. */
>  		case XEN_IDE0_MAJOR:
>  			*offset = (*minor / 64) + EMULATED_HD_DISK_NAME_OFFSET;
> -			*minor = ((*minor / 64) * PARTS_PER_DISK) +
> -				EMULATED_HD_DISK_MINOR_OFFSET;
> +			*minor = *minor + EMULATED_HD_DISK_MINOR_OFFSET;
>  			break;
>  		case XEN_IDE1_MAJOR:
> -			*offset = (*minor / 64) + 2 + EMULATED_HD_DISK_NAME_OFFSET;
> -			*minor = (((*minor / 64) + 2) * PARTS_PER_DISK) +
> -				EMULATED_HD_DISK_MINOR_OFFSET;
> +			*offset = (*minor / 64) + 2 +
> +				  EMULATED_HD_DISK_NAME_OFFSET;
> +			*minor = *minor + (2 * 64) +
> +				 EMULATED_HD_DISK_MINOR_OFFSET;
>  			break;
>  		case XEN_SCSI_DISK0_MAJOR:
>  			*offset = (*minor / PARTS_PER_DISK) + EMULATED_SD_DISK_NAME_OFFSET;
> -- 
> 1.7.4.1
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

  parent reply	other threads:[~2011-07-19 13:22 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-13  9:50 Question on "xen-blkfront: handle Xen major numbers other than XENVBD" Stefan Bader
2011-07-13 10:47 ` Stefano Stabellini
2011-07-13 10:54   ` Ian Campbell
2011-07-13 12:14     ` Stefan Bader
2011-07-13 13:20       ` Stefano Stabellini
2011-07-13 13:45         ` Stefan Bader
2011-07-13 15:34           ` Stefano Stabellini
2011-07-13 16:19             ` Stefan Bader
2011-07-13 17:03               ` Stefano Stabellini
2011-07-13 17:25               ` John Haxby
2011-07-14 13:26                 ` Stefan Bader
2011-07-14 13:30                   ` [PATCH 1/3] xen-blkfront: Drop name and minor adjustments for emulated scsi devices Stefan Bader
2011-07-14 17:32                     ` Stefano Stabellini
2011-07-14 13:30                   ` [PATCH 2/3] xen-blkfront: Fix one off warning about name clash Stefan Bader
2011-07-14 17:33                     ` Stefano Stabellini
2011-07-14 13:30                   ` [PATCH 3/3] xen-blkfront: Fix minor offset calculation for emulated IDE disks Stefan Bader
2011-07-14 17:34                     ` Stefano Stabellini
2011-07-15  6:23                       ` Stefan Bader
2011-07-15 10:20                         ` Stefano Stabellini
2011-07-15 10:41                           ` Stefan Bader
2011-07-19 13:22                     ` Konrad Rzeszutek Wilk [this message]
2011-07-19 16:22                       ` Problem with Xen 4.1 on Ubuntu 11.10 ( Oneiric Ocelot) (HVM DomUs crash) Boris Derzhavets
2011-07-19 17:09                         ` Konrad Rzeszutek Wilk
2011-07-19 17:57                           ` Boris Derzhavets
2011-07-19 17:22                         ` Stefano Stabellini
2011-07-19 18:01                           ` Stefano Stabellini
2011-07-19 19:01                             ` Boris Derzhavets
2011-07-20  8:19                               ` Ian Campbell
2011-07-20  8:24                                 ` Boris Derzhavets
2011-07-20 10:45                                   ` Stefano Stabellini
2011-07-20 12:07                                     ` Boris Derzhavets
2011-07-20 12:11                                     ` Boris Derzhavets
2011-07-20 12:44                                     ` Stefan Bader
2011-07-20 15:03                                       ` Keir Fraser
2011-07-20 15:57                                         ` Boris Derzhavets
2011-07-20 15:59                                           ` Ian Campbell
2011-07-23 17:45                                         ` Boris Derzhavets
2011-07-28 17:58                                         ` Attempt to backport changeset-23088, changeset-23089 to Xen 4.1.1 Boris Derzhavets
2011-07-28 19:04                                           ` Keir Fraser
2011-07-28 19:41                                             ` Boris Derzhavets
2011-07-28 19:53                                               ` Keir Fraser
2011-07-28 21:50                                                 ` Boris Derzhavets
2011-07-28 22:12                                                   ` Keir Fraser
2011-07-28 22:02                                                 ` Re: Attempt to backport changeset-23088, changeset-23089 to Xen 4.1.1- Notice of Ian Campbell Boris Derzhavets
2011-07-29  7:08                                                   ` Stefan Bader
2011-07-29  9:30                                                     ` Boris Derzhavets
2011-07-29 14:41                                                       ` Boris Derzhavets
2011-07-21  8:01                                     ` problem with xentrace_format in Xen 4.0.1 Zhiyuan Shao
2011-07-19 19:44                             ` Re: Problem with Xen 4.1 on Ubuntu 11.10 ( Oneiric Ocelot) (HVM DomUs crash) Boris Derzhavets
2011-07-14 14:14                   ` Re: Question on "xen-blkfront: handle Xen major numbers other than XENVBD" Ian Campbell
2011-07-14 15:01                     ` Stefan Bader
2011-07-14 14:48           ` Ian Jackson

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=20110719132259.GA5191@dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=stefan.bader@canonical.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /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.