func: static int32_t scsi_target_send_command(SCSIRequest *req, uint8_t *buf) SCSITargetReq * r = DO_UPCAST ( SCSITargetReq , req , req ) ; switch ( buf [ 0 ] )  if ( ! scsi_target_emulate_report_luns ( r ) )  static bool scsi_target_emulate_report_luns(SCSITargetReq *r) BusChild * kid ; int i , len , n ; int channel , id ; bool found_lun0 ; if ( r -> req . cmd . xfer < 16 )  if ( r -> req . cmd . buf [ 2 ] > 2 )  channel = r -> req . dev -> channel; id = r -> req . dev -> id; found_lun0 = false; n = 0; DeviceState * qdev = kid -> child ; SCSIDevice * dev = SCSI_DEVICE ( qdev ) ; if ( dev -> channel == channel && dev -> id == id )  if ( dev -> lun == 0 )  found_lun0 = true; n += 8; if ( ! found_lun0 )  n += 8; len = MIN ( n + 8 , r -> req . cmd . xfer & ~7 ); memset ( r -> buf , 0 , len ); stl_be_p ( & r -> buf [ 0 ] , n ); QTAILQ_FOREACH ( kid , & r -> req . bus -> qbus . children , sibling ) store_lun ( & r -> buf [ i ] , dev -> lun ); static void store_lun(uint8_t *outbuf, int lun) if ( lun < 256 )  outbuf [ 1 ] = lun; outbuf [ 1 ] = ( lun & 255 ); outbuf [ 0 ] = ( lun >> 8 ) | 0x40; r -> len = len; 