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 #ifde

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. >> >> Stefa

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 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 would r

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 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_S

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, >

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 arc

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 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,

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 tha

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 !__s3

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 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; >> +bdrv_

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);

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 > > This patch uses ioctl HDIO_GETGEO to guess geometry of a disk in > case nothing is specified explicitly. > > Signed-off-by: Einar Lueck > Signed-off-by: Christian Borntraeger > --- > block.c | 12 > 1

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

2012-04-26 Thread Christian Borntraeger
From: Einar Lueck This patch uses ioctl HDIO_GETGEO to guess geometry of a disk in case nothing is specified explicitly. Signed-off-by: Einar Lueck Signed-off-by: Christian Borntraeger --- block.c | 12 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/block.c b/b