# ferreus_orbit Plugins for qemu based VM

fo_get_sorted_name(){
  if [ -n "$ID_BUS" ] && [ "$ID_BUS" = "scsi" ]; then
    local card=$(echo $DEVPATH | cut -d/ -f5)
    local target=$(echo $DEVPATH | cut -d/ -f8| cut -d: -f3)
    if [ "$card" = "virtio0" ] || [ "$card" = "virtio1" ] ; then
      local disk=sd$(fo_get_dev_letter ${target})
      logger -t "udev" "Adding symlink $disk for device $card-$target"
      if [ "$USE_FO_NAME" -lt 1 ]; then
        echo $disk
        exit 0
      else
        local box=$(echo "${card}" | awk -F "virtio" '{print $2}')
        echo Box${box}-Disk${target}
        exit 0
      fi
    else
      logger -t "udev" "Device $DEVPATH detected but not supported"; exit 1
    fi
  else
    logger -t "udev" "Device $DEVPATH detected but not supported"; exit 1
  fi
}

fo_get_did(){
  fo_get_id $1
}

fo_get_id(){
  if [ -n "$ID_BUS" ] && [ "$ID_BUS" = "scsi" ]; then
    local id=$(echo $DEVPATH | cut -d/ -f8| cut -d: -f3)
  fi
  echo $id
}

fo_check_raid(){
  false
}

fo_build_dispo(){
  return 0
}

FO_DISPOSITION="Disposition unavailable"
