qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 0/6] Geometry and blocksize support for backi


From: Markus Armbruster
Subject: Re: [Qemu-devel] [PATCH v2 0/6] Geometry and blocksize support for backing devices
Date: Fri, 28 Nov 2014 14:40:52 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Ekaterina Tumanova <address@hidden> writes:

> On 11/28/2014 01:35 PM, Stefan Hajnoczi wrote:
>> On Wed, Nov 26, 2014 at 01:16:48PM +0300, Ekaterina Tumanova wrote:
>>> On 11/25/2014 04:01 PM, Stefan Hajnoczi wrote:
>>>> On Wed, Nov 19, 2014 at 11:17:50AM +0100, Ekaterina Tumanova wrote:
>>>> 3. Why does s390 need to customize hd_geometry_guess()?
>>>>
>>> Since hd_geometry_guess contains semantics of x86-specific LBA translation,
>>> we have to modify it not to get in the way of z
>>> architecture
>>
>> If the behavior is x86-specific, it should be made x86-specific.  z,
>> ppc, sparc, arm, etc should share the non-x86-specific code path.  It's
>> weird to single out z here, this seems like the wrong way around.
>>
>> Is the x86-specific behavior a problem in practice?  No one seemed to
>> mind for the other targets.
>>
>
> on s390 arch this adds support for FCP attached SCSI disks that do not
> yet have a partition table. Without this patch, fdisk -l on the host
> would return different results then fdisk -l in the guest.

Isn't it like this for all targets?

    If we can't guess LCHS from MSDOS partition table
        guess geometry on size
        translation is NONE for very small disk, else LBA
    Else if LCHS guess has heads > 16
        BIOS LBA translation must be active
        guess geometry on size
        translation is LARGE for sufficiently small disk, else LBA
    Else
        use LCHS guess
        translation is NONE

Before writing a partition table, the default geometry is based on size.

Afterwards, we it may be based on the partition table instead.

Yes, writing an MS-DOS partition table can change the default geometry.
Horrible misfeature, independent of target.  Every time I try to kill a
horrible misfeature, Kevin yells at me ;)

Mitigating factor 1: no change when the partition table looks like LBA
is active.  Should be the common case nowadays.

Mitigating factor 2: most guest software is blissfully unaware of
geometry.

> If you guys don't like the way patch goes, I can exclude it from patch
> series and we can discuss it later.
>
> But I thought that since it's related to the hard drive geometry,
> and since we change hd_geometry_guess in this patchset anyway, why not
> get rid of this problem as well.

I think we should discuss what we actually want, then let you implement
it.

Perhaps the stupidest solution that could possibly work is the state
after your PATCH 5:

    If backend has a geometry (currently only DASD has; may change)
        // Incompatible change!
        use backend geometry
        translation is NONE
    Else if we can't guess LCHS from MSDOS partition table
        guess geometry on size
        translation is NONE for very small disk, else LBA
    Else if LCHS guess has heads > 16
        BIOS LBA translation must be active
        guess geometry on size
        translation is LARGE for sufficiently small disk, else LBA
    Else
        use LCHS guess
        translation is NONE

Note that translation is relevant only for a PC machine's IDE disks.
Everything else ignores it.



reply via email to

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