Closed ruzzle closed 2 years ago
Thanks for the report. I'll need to test this case more closely to build a patch.
I have also run into this issue and would like to have it fixed. I tested the solution mentioned above and it disconnects the /dev/nbd# devices properly.
elif not os.path.ismount(mountpoint) and cmd[0] != 'qemu-nbd':
I have fixed this issue in e340fcf92583f9b333d088d71c8655094695363b
When unmounting mounted .qcow2- or .vdi-images, the /dev/nbd# device fails to disconnect. This is caused by the ismount check in _util.clean_unmount:
elif not os.path.ismount(mountpoint):
Because the /dev/nbd# device does not actually show up in the mounts lists, the check returns True and the check_call is never reached, so the /dev/nbd# device stays (erroneously) intact.
An option might be to change the above line to:
elif not os.path.ismount(mountpoint) and cmd[0] != 'qemu-nbd':