[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] Add 'serial' attribute to virtio-blk device
From: |
Ryan Harper |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] Add 'serial' attribute to virtio-blk devices |
Date: |
Mon, 21 Jun 2010 11:45:20 -0500 |
User-agent: |
Mutt/1.5.6+20040907i |
* Christoph Hellwig <address@hidden> [2010-06-21 07:46]:
> On Fri, Jun 18, 2010 at 01:38:02PM -0500, Ryan Harper wrote:
> > Create a new attribute for virtio-blk devices that will fetch the serial
> > number
> > of the block device. This attribute can be used by udev to create
> > disk/by-id
> > symlinks for devices that don't have a UUID (filesystem) associated with
> > them.
> >
> > ATA_IDENTIFY strings are special in that they can be up to 20 chars long
> > and aren't required to be NULL-terminated. The buffer is also zero-padded
> > meaning that if the serial is 19 chars or less that we get a NULL terminated
> > string. When copying this value into a string buffer, we must be careful to
> > copy up to the NULL (if it present) and only 20 if it is longer and not to
> > attempt to NULL terminate; this isn't needed.
>
> Why is this virtio-blk specific? In a later mail you mention you want
> to use it for udev. So please export this from scsi/libata as well and
> we have one proper interface that we can use for all devices.
ATA and SCSI devices are already supported via ata_id and scsi_id
commands included in udev. Qemu implements the drive serial part for
them and udev creates proper disk/by-id links. This patch is about
filling the gap for virtio-blk devices which cannot work with ata_id and
scsi_id.
--
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
address@hidden
- Re: [Qemu-devel] [PATCH 1/2] Add 'serial' attribute to virtio-blk devices, (continued)
Re: [Qemu-devel] [PATCH 1/2] Add 'serial' attribute to virtio-blk devices, Christoph Hellwig, 2010/06/21
- Re: [Qemu-devel] [PATCH 1/2] Add 'serial' attribute to virtio-blk devices,
Ryan Harper <=