svn commit: r251654 - in head/sys: cam cam/scsi geom
Dimitry Andric
dim at FreeBSD.org
Wed Jun 12 18:29:29 UTC 2013
On Jun 12, 2013, at 15:36, Alexander Motin <mav at FreeBSD.org> wrote:
> Author: mav
> Date: Wed Jun 12 13:36:20 2013
> New Revision: 251654
> URL: http://svnweb.freebsd.org/changeset/base/251654
>
> Log:
> Make CAM return and GEOM DISK pass through new GEOM::lunid attribute.
>
> SPC-4 specification states that serial number may be property of device,
> but not a specific logical unit. People reported about FC storages using
> serial number in that way, making it unusable for purposes of LUN multipath
> detection. SPC-4 states that designators associated with logical unit from
> the VPD page 83h "Device Identification" should be used for that purpose.
> Report first of them in the new attribute in such preference order: NAA,
> EUI-64, T10 and SCSI name string.
>
> While there, make GEOM DISK properly report GEOM::ident in XML output also
> using d_getattr() method, if available. This fixes serial numbers reporting
> for SCSI disks in `geom disk list` output and confxml.
>
> Discussed with: gibbs, ken
> Sponsored by: iXsystems, Inc.
> MFC after: 2 weeks
>
> Modified:
> head/sys/cam/cam_xpt.c
> head/sys/cam/scsi/scsi_all.c
> head/sys/cam/scsi/scsi_all.h
> head/sys/cam/scsi/scsi_enc_ses.c
> head/sys/geom/geom_disk.c
....
> Modified: head/sys/cam/scsi/scsi_all.h
> ==============================================================================
> --- head/sys/cam/scsi/scsi_all.h Wed Jun 12 13:17:43 2013 (r251653)
> +++ head/sys/cam/scsi/scsi_all.h Wed Jun 12 13:36:20 2013 (r251654)
> @@ -1292,6 +1292,7 @@ struct scsi_vpd_id_descriptor
> #define SVPD_ID_PROTO_SHIFT 4
> #define SVPD_ID_CODESET_BINARY 0x01
> #define SVPD_ID_CODESET_ASCII 0x02
> +#define SVPD_ID_CODESET_UTF8 0x03
> #define SVPD_ID_CODESET_MASK 0x0f
> u_int8_t id_type;
> #define SVPD_ID_PIV 0x80
> @@ -2316,7 +2317,12 @@ u_int scsi_calc_syncparam(u_int period)
> typedef int (*scsi_devid_checkfn_t)(uint8_t *);
> int scsi_devid_is_naa_ieee_reg(uint8_t *bufp);
> int scsi_devid_is_sas_target(uint8_t *bufp);
> -uint8_t * scsi_get_devid(struct scsi_vpd_device_id *id, uint32_t len,
> +int scsi_devid_is_lun_eui64(uint8_t *bufp);
> +int scsi_devid_is_lun_naa(uint8_t *bufp);
> +int scsi_devid_is_lun_name(uint8_t *bufp);
> +int scsi_devid_is_lun_t10(uint8_t *bufp);
> +struct scsi_vpd_id_descriptor *
> + scsi_get_devid(struct scsi_vpd_device_id *id, uint32_t len,
> scsi_devid_checkfn_t ck_fn);
This prototype change breaks head:
cc -O2 -pipe -DRESCUE -std=gnu99 -Qunused-arguments -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wmissing-variable-declarations -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -c /src/sbin/camcontrol/camcontrol.c
/src/sbin/camcontrol/camcontrol.c:6955:13: error: incompatible pointer types assigning to 'uint8_t *' (aka 'unsigned char *') from 'struct scsi_vpd_id_descriptor *' [-Werror,-Wincompatible-pointer-types]
item_addr = scsi_get_devid(item->device_id,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
More information about the svn-src-head
mailing list