func (t *Target) handleVPD(s *Session, m, resp *packet.Message) { lun := int(m.LUN) alloc := int(packet.ParseUint(m.CDB[3:5])) vpd, err := t.LUNs[lun].VitalProductData(m.CDB[2]) if err != nil { resp.Status = 0x02 resp.SCSIResponse = 0x01 return } resp.RawData = vpd if len(vpd) >= alloc { resp.RawData = resp.RawData[:alloc] } }