From: Anthony PERARD Subject: In blkif.h, sector unit is not clear Date: Wed, 8 Oct 2014 17:20:53 +0100 Message-ID: <20141008162053.GB1742@perard.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Xen Devel Cc: Ian Jackson , Ian Campbell , Jan Beulich List-Id: xen-devel@lists.xenproject.org I'm trying to understand the different device properties exposed on xenstore for a block device. And there is one property that is contradictory within blkif.h, "sectors". There are two possible units for it, either "sector-size" or 512-byte. Which one it is? My guess is that it does not matter too much since "sector-size" is probably always reported as 512. Here is the interesting part of xen/include/public/io/blkif.h: @@ -198,1 +198,1 @@ *------------------------- Backend Device Properties ------------------------- @@ -241,18 +241,18 @@ * sector-size * Values: * * The logical sector size, in bytes, of the backend device. * * physical-sector-size * Values: * * The physical sector size, in bytes, of the backend device. * * sectors * Values: * * The size of the backend device, expressed in units of its logical * sector size ("sector-size"). HERE: unit for "sectors" is "sector-size" @@ -547,10 +547,10 @@ /* * NB. first_sect and last_sect in blkif_request_segment, as well as * sector_number in blkif_request, are always expressed in 512-byte units. * However they must be properly aligned to the real sector size of the * physical disk, which is reported in the "physical-sector-size" node in * the backend xenbus info. Also the xenbus "sectors" node is expressed in * 512-byte units. */ struct blkif_request_segment { grant_ref_t gref; /* reference to I/O buffer frame */ HERE: unit for "sectors" is 512-byte Regards, -- Anthony PERARD