Comment 6 for bug 342359

Revision history for this message
Jamie Strandboge (jdstrand) wrote :

Attached is a patch that should address this issue. Basically, it will try up to three times to unmount the disk, rather than failing on the first time. Example output from an attempt that would have previously failed:
...
2009-03-24 00:42:12,075 INFO Unmounting target filesystem
2009-03-24 00:42:12,076 DEBUG Unmounting /tmp/vmbuilderYGTk5J/target/
2009-03-24 00:42:12,076 DEBUG ['umount', '/tmp/vmbuilderYGTk5J/target/']
2009-03-24 00:42:12,488 INFO Attempting to unmount disk '/tmp/vmbuilderYGTk5J/disk0.img'
2009-03-24 00:42:12,489 DEBUG ['kpartx', '-d', '/tmp/vmbuilderYGTk5J/disk0.img']
2009-03-24 00:42:12,502 INFO device-mapper: remove ioctl failed: Device or resource busy
2009-03-24 00:42:12,504 INFO ioctl: LOOP_CLR_FD: Device or resource busy
2009-03-24 00:42:12,504 INFO Failed to unmount disk '/tmp/vmbuilderYGTk5J/disk0.img'
2009-03-24 00:42:15,507 INFO Attempting to unmount disk '/tmp/vmbuilderYGTk5J/disk0.img'
2009-03-24 00:42:15,507 DEBUG ['kpartx', '-d', '/tmp/vmbuilderYGTk5J/disk0.img']
2009-03-24 00:42:15,519 DEBUG loop deleted : /dev/loop6
2009-03-24 00:42:15,520 INFO Converting /tmp/vmbuilderYGTk5J/disk0.img to qcow2, format debian-kvm/disk0.qcow2
...