> +_nvmet_target_cleanup() { > + local ports > + local port > + local blkdev > + > + _get_nvmet_ports "${def_subsysnqn}" ports > + > + for port in "${ports[@]}"; do > + _remove_nvmet_subsystem_from_port "${port}" "${def_subsysnqn}" > + done > + _remove_nvmet_subsystem "${def_subsysnqn}" > + _remove_nvmet_port "${port}" _remove_nvmet_port should be also be part of the loop. > + _remove_nvmet_host "${def_hostnqn}" > + > + blkdev="$(losetup -l | awk '$6 == "'"${def_file_path}"'" { print $1 }')" > + if [[ -n "${blkdev}" ]] ; then > + losetup -d "${blkdev}" > + fi > + rm "${def_file_path}" > +} > +