From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ryan Harper Date: Tue, 29 Jun 2010 14:48:34 +0000 Subject: Re: [PATCH 1/3] Add virtioblk_id tool to extract drive serial numbers Message-Id: <20100629144834.GD1647@us.ibm.com> List-Id: References: <1275592024-2625-2-git-send-email-ryanh@us.ibm.com> In-Reply-To: <1275592024-2625-2-git-send-email-ryanh@us.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable To: linux-hotplug@vger.kernel.org * Kay Sievers [2010-06-14 08:30]: > On Mon, Jun 14, 2010 at 15:15, Ryan Harper wrote: > > * Kay Sievers [2010-06-14 03:55]: > >> On Thu, Jun 10, 2010 at 21:16, Ryan Harper wrote: > >> > Use the 'VBID' virtio-blk ioctl to extract drive serial numbers > >> > to be used for building disk/by-id symlinks. =A0After extracting > >> > the serial number of the device it prints out the minimum info > >> > needed in a similar format to `scsi_id --export` so that the > >> > persistent-storage rules can process the serial information. > >> > > >> > This program depends on the virtio-blk serial device patches posted > >> > here[1] being applied to qemu and linux-kernel. > >> > > >> > Here is what the output looks like: > >> > > >> > % ./virtioblk_id /dev/vdb > >> > ID_VIRTIO=3D1 > >> > ID_TYPE=3Ddisk > >> > ID_SERIAL=3DQM00001 > >> > ID_SERIAL_SHORT=3DQM00001 > >> > >> As requested in the ealier mail. Please provide a good reason why the > >> kernel code can not create a "serial" file (or whatever fits your > >> needs) in sysfs at the block device. > > > > I didn't see you respond John's email: > > > > http://www.spinics.net/lists/hotplug/msg03869.html > > > > which included quite =A0bit of the gory history on this topic. >=20 > Yeah, and I don't find any reason there, why a sysfs attribute will not w= ork. You were quite right; the sysfs attribute route was rather simple. Thanks for pointing me in the right direction. We've got the kernel-side fix picked up. I've posted v3 of this series that uses the sysfs attribute. Thanks! --=20 Ryan Harper Software Engineer; Linux Technology Center IBM Corp., Austin, Tx ryanh@us.ibm.com