Re: [Qemu-devel] [PATCH 1/2] Add 'serial' attribute to virtio-blk devices

2010-06-21 Thread Ryan Harper
* Christoph Hellwig [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 de

Re: [Qemu-devel] [PATCH 1/2] Add 'serial' attribute to virtio-blk devices

2010-06-21 Thread Christoph Hellwig
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 wit

Re: [Qemu-devel] [PATCH 1/2] Add 'serial' attribute to virtio-blk devices

2010-06-19 Thread Blue Swirl
On Sat, Jun 19, 2010 at 10:58 AM, Ulrich Drepper wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > On 06/19/2010 01:24 AM, Blue Swirl wrote: >>> +static inline int serial_sysfs(char *d, char *s, int n) >>> +{ >>> +       char *di = d; >> >> I'd change this to: >> static inline ssize_t s

Re: [Qemu-devel] [PATCH 1/2] Add 'serial' attribute to virtio-blk devices

2010-06-19 Thread Ulrich Drepper
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 06/19/2010 01:24 AM, Blue Swirl wrote: >> +static inline int serial_sysfs(char *d, char *s, int n) >> +{ >> + char *di = d; > > I'd change this to: > static inline ssize_t serial_sysfs(char *d, const char *s, ssize_t n) > { >const cha

Re: [Qemu-devel] [PATCH 1/2] Add 'serial' attribute to virtio-blk devices

2010-06-19 Thread Blue Swirl
On Fri, Jun 18, 2010 at 6:38 PM, 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.

[Qemu-devel] [PATCH 1/2] Add 'serial' attribute to virtio-blk devices

2010-06-18 Thread Ryan Harper
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