Re: [Qemu-devel] [PATCH 2/3] geometry detection: use HDIO_GETGEO

2012-05-02 Thread Christian Borntraeger
On 27/04/12 18:12, Paolo Bonzini wrote: Il 26/04/2012 15:49, Christian Borntraeger ha scritto: +#ifdef __linux__ +} else if (bdrv_ioctl(bs, HDIO_GETGEO, geo) == 0) { +*pcyls = geo.cylinders; +*pheads = geo.heads; +*psecs = geo.sectors; +

Re: [Qemu-devel] [PATCH 2/3] geometry detection: use HDIO_GETGEO

2012-05-02 Thread Alexander Graf
On 05/02/2012 12:27 PM, Christian Borntraeger wrote: On 27/04/12 18:12, Paolo Bonzini wrote: Il 26/04/2012 15:49, Christian Borntraeger ha scritto: +#ifdef __linux__ +} else if (bdrv_ioctl(bs, HDIO_GETGEO,geo) == 0) { +*pcyls = geo.cylinders; +*pheads = geo.heads; +

Re: [Qemu-devel] [PATCH 2/3] geometry detection: use HDIO_GETGEO

2012-05-02 Thread Paolo Bonzini
and everyone should be happy :). I would really like to have as little #ifdef TARGET_S390 code in QEMU. And #ifdef __s390__ is even worse, as it means we won't be able to execise that code path on other architectures. True, but how do you exercise that code path with DASD geometry on

Re: [Qemu-devel] [PATCH 2/3] geometry detection: use HDIO_GETGEO

2012-05-02 Thread Alexander Graf
On 05/02/2012 01:26 PM, Paolo Bonzini wrote: and everyone should be happy :). I would really like to have as little #ifdef TARGET_S390 code in QEMU. And #ifdef __s390__ is even worse, as it means we won't be able to execise that code path on other architectures. True, but how do you exercise

Re: [Qemu-devel] [PATCH 2/3] geometry detection: use HDIO_GETGEO

2012-05-02 Thread Paolo Bonzini
On 05/02/2012 01:26 PM, Paolo Bonzini wrote: and everyone should be happy :). I would really like to have as little #ifdef TARGET_S390 code in QEMU. And #ifdef __s390__ is even worse, as it means we won't be able to execise that code path on other architectures. True, but how do you

Re: [Qemu-devel] [PATCH 2/3] geometry detection: use HDIO_GETGEO

2012-05-02 Thread Christian Borntraeger
As hinted in my other mail, I think the way to go would be to give a hint to the geometry code that we're running on a DASD disk.. Just as an idea if we are going that path, we might use the BIODASDINFO2 or DASDAPIVER ioctls in qemu to detect if that is a dasd. Christian

Re: [Qemu-devel] [PATCH 2/3] geometry detection: use HDIO_GETGEO

2012-05-02 Thread Alexander Graf
On 05/02/2012 01:38 PM, Paolo Bonzini wrote: On 05/02/2012 01:26 PM, Paolo Bonzini wrote: and everyone should be happy :). I would really like to have as little #ifdef TARGET_S390 code in QEMU. And #ifdef __s390__ is even worse, as it means we won't be able to execise that code path on other

Re: [Qemu-devel] [PATCH 2/3] geometry detection: use HDIO_GETGEO

2012-05-02 Thread Christian Borntraeger
On 02/05/12 14:54, Alexander Graf wrote: On 05/02/2012 01:38 PM, Paolo Bonzini wrote: On 05/02/2012 01:26 PM, Paolo Bonzini wrote: and everyone should be happy :). I would really like to have as little #ifdef TARGET_S390 code in QEMU. And #ifdef __s390__ is even worse, as it means we won't

Re: [Qemu-devel] [PATCH 2/3] geometry detection: use HDIO_GETGEO

2012-05-02 Thread Alexander Graf
On 02.05.2012, at 16:27, Christian Borntraeger borntrae...@de.ibm.com wrote: On 02/05/12 14:54, Alexander Graf wrote: On 05/02/2012 01:38 PM, Paolo Bonzini wrote: On 05/02/2012 01:26 PM, Paolo Bonzini wrote: and everyone should be happy :). I would really like to have as little #ifdef

Re: [Qemu-devel] [PATCH 2/3] geometry detection: use HDIO_GETGEO

2012-05-02 Thread Alexander Graf
On 02.05.2012, at 17:57, Stefan Weinhuber w...@linux.vnet.ibm.com wrote: On 2012-05-02 16:27, Christian Borntraeger wrote: On 02/05/12 14:54, Alexander Graf wrote: On 05/02/2012 01:38 PM, Paolo Bonzini wrote: On 05/02/2012 01:26 PM, Paolo Bonzini wrote: and everyone should be happy :). I

Re: [Qemu-devel] [PATCH 2/3] geometry detection: use HDIO_GETGEO

2012-05-02 Thread Christian Borntraeger
Well, if guessing is a function guess_size(disk_size, block_size) then we would be able to do the same on an image file. Christian, would that work? I think that the geometry values can not always be guessed correctly based on block_size and disk_size. Stefan, can you clarify that?

Re: [Qemu-devel] [PATCH 2/3] geometry detection: use HDIO_GETGEO

2012-05-02 Thread Stefan Weinhuber
On 2012-05-02 16:27, Christian Borntraeger wrote: On 02/05/12 14:54, Alexander Graf wrote: On 05/02/2012 01:38 PM, Paolo Bonzini wrote: On 05/02/2012 01:26 PM, Paolo Bonzini wrote: and everyone should be happy :). I would really like to have as little #ifdef TARGET_S390 code in QEMU. And

Re: [Qemu-devel] [PATCH 2/3] geometry detection: use HDIO_GETGEO

2012-04-27 Thread Paolo Bonzini
Il 26/04/2012 15:49, Christian Borntraeger ha scritto: +#ifdef __linux__ +} else if (bdrv_ioctl(bs, HDIO_GETGEO, geo) == 0) { +*pcyls = geo.cylinders; +*pheads = geo.heads; +*psecs = geo.sectors; +bdrv_set_geometry_hint(bs, *pcyls, *pheads, *psecs);

[Qemu-devel] [PATCH 2/3] geometry detection: use HDIO_GETGEO

2012-04-26 Thread Christian Borntraeger
From: Einar Lueck elelu...@de.ibm.com This patch uses ioctl HDIO_GETGEO to guess geometry of a disk in case nothing is specified explicitly. Signed-off-by: Einar Lueck elelu...@de.ibm.com Signed-off-by: Christian Borntraeger borntrae...@de.ibm.com --- block.c | 12 1 files

Re: [Qemu-devel] [PATCH 2/3] geometry detection: use HDIO_GETGEO

2012-04-26 Thread Alexander Graf
On 26.04.2012, at 15:49, Christian Borntraeger wrote: From: Einar Lueck elelu...@de.ibm.com This patch uses ioctl HDIO_GETGEO to guess geometry of a disk in case nothing is specified explicitly. Signed-off-by: Einar Lueck elelu...@de.ibm.com Signed-off-by: Christian Borntraeger