From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37307) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ta7Rh-0003YN-KC for qemu-devel@nongnu.org; Sun, 18 Nov 2012 11:10:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ta7Re-0006FC-7c for qemu-devel@nongnu.org; Sun, 18 Nov 2012 11:10:09 -0500 Received: from mail-wi0-f181.google.com ([209.85.212.181]:41825) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ta7Rd-0006D7-Q4 for qemu-devel@nongnu.org; Sun, 18 Nov 2012 11:10:06 -0500 Received: by mail-wi0-f181.google.com with SMTP id hm2so2195751wib.10 for ; Sun, 18 Nov 2012 08:10:04 -0800 (PST) Sender: Paolo Bonzini Message-ID: <50A9085A.8010704@redhat.com> Date: Sun, 18 Nov 2012 17:10:02 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1352796612-49081-1-git-send-email-borntraeger@de.ibm.com> <1352796612-49081-3-git-send-email-borntraeger@de.ibm.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/3] hd-geometry.c/s390: Disable geometry translation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Blue Swirl Cc: kwolf@redhat.com, aliguori@us.ibm.com, stefanha@gmail.com, qemu-devel@nongnu.org, agraf@suse.de, Christian Borntraeger , jfrei@linux.vnet.ibm.com, cornelia.huck@de.ibm.com, Einar Lueck , Einar Lueck Il 17/11/2012 17:07, Blue Swirl ha scritto: > On Tue, Nov 13, 2012 at 8:50 AM, Christian Borntraeger > wrote: >> From: Einar Lueck >> >> This patch disables the translation of geometry information read from >> disks on s390. On s390 such translations lead to wrong geometries being >> advertized to the guest because there is no entity doing these kinds >> of translation on this architecture. >> >> Signed-off-by Einar Lueck >> Signed-off-by Christian Borntraeger >> --- >> hw/hd-geometry.c | 5 +++++ >> 1 file changed, 5 insertions(+) >> >> diff --git a/hw/hd-geometry.c b/hw/hd-geometry.c >> index 4cf040d..db1dc81 100644 >> --- a/hw/hd-geometry.c >> +++ b/hw/hd-geometry.c >> @@ -144,6 +144,10 @@ static int guess_disk_msdosgeo(BlockDriverState *bs, >> continue; >> } >> >> +#ifdef __s390__ > > No, this would make all system emulators (e.g. x86) on s390 host to > use this translation, not just s390. I think you want to use #ifdef > CONFIG_S390X instead. This symbol is not available because this file is compiled just once. Which non-x86 targets actually care about translation stuff? Probably it would be best to split the MS-DOS stuff in a separate file, and use the stub mechanism (no weak symbols, alas :)) to provide a default implementation that just returns BIOS_ATA_TRANSLATION_NONE. >> + /* on s390 there is no BIOS doing any kind of translation */ >> + translation = BIOS_ATA_TRANSLATION_NONE; >> +#else >> if (heads > 16) { >> /* LCHS guess with heads > 16 means that a BIOS LBA >> translation was active, so a standard physical disk >> @@ -158,6 +162,7 @@ static int guess_disk_msdosgeo(BlockDriverState *bs, >> the logical geometry */ >> translation = BIOS_ATA_TRANSLATION_NONE; >> } >> +#endif >> *pheads = heads; >> *psectors = sectors; >> *pcylinders = cylinders; >> -- >> 1.7.10.1 >> >> > >