Received: from eggs.gnu.org ([2001:4830:134:3::10]:51656) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyhLD-0006X9-8A for qemu-devel@nongnu.org; Wed, 10 Dec 2014 08:30:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XyhL1-00061O-Ie for qemu-devel@nongnu.org; Wed, 10 Dec 2014 08:30:07 -0500 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:43190) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XyhL1-00060q-9P for qemu-devel@nongnu.org; Wed, 10 Dec 2014 08:29:55 -0500 Received: from /spool/local by e06smtp13.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 10 Dec 2014 13:29:53 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id 9C28D17D8043 for ; Wed, 10 Dec 2014 13:30:12 +0000 (GMT) Received: from d06av07.portsmouth.uk.ibm.com (d06av07.portsmouth.uk.ibm.com [9.149.37.248]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id sBADTocx56295600 for ; Wed, 10 Dec 2014 13:29:50 GMT Received: from d06av07.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av07.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id sBADTncD021554 for ; Wed, 10 Dec 2014 08:29:50 -0500 Date: Wed, 10 Dec 2014 14:29:48 +0100 From: Thomas Huth Message-ID: <20141210142948.5b5c1464@oc7435384737.ibm.com> In-Reply-To: <1417802181-20834-6-git-send-email-tumanova@linux.vnet.ibm.com> References: <1417802181-20834-1-git-send-email-tumanova@linux.vnet.ibm.com> <1417802181-20834-6-git-send-email-tumanova@linux.vnet.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v3 5/5] BlockConf: Call backend functions to detect geometry and blocksizes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Ekaterina Tumanova Cc: kwolf@redhat.com, borntraeger@de.ibm.com, armbru@redhat.com, Public KVM Mailing List , mihajlov@linux.vnet.ibm.com, dahi@linux.vnet.ibm.com, stefanha@redhat.com, cornelia.huck@de.ibm.com, pbonzini@redhat.com This patch looks basically good to me, I just got some cosmetic requests: On Fri, 5 Dec 2014 18:56:21 +0100 Ekaterina Tumanova wrote: ... > diff --git a/hw/block/hd-geometry.c b/hw/block/hd-geometry.c > index 6fcf74d..fbd602d 100644 > --- a/hw/block/hd-geometry.c > +++ b/hw/block/hd-geometry.c > @@ -121,7 +121,17 @@ void hd_geometry_guess(BlockBackend *blk, > int *ptrans) > { > int cylinders, heads, secs, translation; > + hdGeometry geo; > > + /* Try to probe the backing device geometry, otherwise fallback > + to the old logic. (as of 12/2014 probing only succeeds on DASDs) */ > + if (blk_probe_geometry(blk, &geo) == 0) { > + *pcyls = geo.cylinders; > + *psecs = geo.sectors; > + *pheads = geo.heads; > + translation = BIOS_ATA_TRANSLATION_NONE; > + goto done; > + } > if (guess_disk_lchs(blk, &cylinders, &heads, &secs) < 0) { Can you get rid of the "goto" above by placing an "else" in front of this if-statement? > /* no LCHS guess: use a standard physical disk geometry */ > guess_chs_for_size(blk, pcyls, pheads, psecs); > @@ -142,7 +152,9 @@ void hd_geometry_guess(BlockBackend *blk, > /* disable any translation to be in sync with > the logical geometry */ > translation = BIOS_ATA_TRANSLATION_NONE; > + Unnecessary empty line, please remove this hunk. > } > +done: > if (ptrans) { > *ptrans = translation; > } Thomas