qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 1/3] Fix geometry sector calculation


From: Christian Borntraeger
Subject: Re: [Qemu-devel] [PATCH 1/3] Fix geometry sector calculation
Date: Wed, 02 May 2012 12:18:30 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120412 Thunderbird/11.0.1

>> +    blkcfg.sectors = secs & ~(blk_size / pblk_size - 1);
> 
> I'm not sure here what you mean.  Usually blk_size >= pblk_size on
> non-s390 systems, so this is completely different from the previous
> code, which is effectively

I was trying to prevent the masking of the sector number. 
the first version of the patch simply did
blkcfg.sectors = secs;
but this broke setups that really need that masking.

> 
>    blkcfg.sectors = secs & ~(blk_size / 512 - 1);
> 
> I wonder if s390 gives a different meaning to logical vs. physical
> sector sizes, compared to what virtio expects (which is what SCSI says,
> basically).  Physical block sizes on non-s390 systems are really just
> useful as an alignment hint, they do not affect correctness.

Maybe that really points to the problem that we are trying to solve here.
For a dasd device, there is usually a 4096 byte block size and on the host
these 4096 arereported via getss and getpbsz. 
The geometry reported by the device driver is usually 15 head and 12 sectors
per track, but actually means 12 sectors of 4096 bytes size (a track ~ 48k).

What I want to achieve is that the guest view is identical to the host view
for
cyls, heads, secs, and all block sizes.

Christian




reply via email to

[Prev in Thread] Current Thread [Next in Thread]