qcow2 umount changed

Force fs sync on umount and reverse kpartx/qemu-nbd unloading
This commit is contained in:
Holger Pandel 2019-11-20 14:19:59 +01:00 committed by GitHub
parent 04201efcc1
commit 0bca0f15ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,6 +38,7 @@ export -f mount_qimage
# umount qcow2 image: umount_image <current mountpoint>
umount_qimage() {
sync
while mount | grep -q "$1"; do
local LOCS
LOCS=$(mount | grep "$1" | cut -f 3 -d ' ' | sort -r)
@ -46,8 +47,8 @@ umount_qimage() {
umount "$loc"
done
done
qemu-nbd -d $NBD_DEV
kpartx -d $NBD_DEV
qemu-nbd -d $NBD_DEV
}
export -f umount_qimage