Skip to content

Instantly share code, notes, and snippets.

@libcrack
Created May 4, 2016 23:03
Show Gist options
  • Select an option

  • Save libcrack/d94f8a68cd03f006c19e18a4c0a0ffd4 to your computer and use it in GitHub Desktop.

Select an option

Save libcrack/d94f8a68cd03f006c19e18a4c0a0ffd4 to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
# jue nov 13 21:33:12 CET 2014
if [ -f ~/.bash_colors ]; then . ~/.bash_colors; fi
if [ -f ~/.bash_functions ]; then . ~/.bash_functions; fi
for img in /var/lib/libvirt/images/*.img; do
new="${img%.*}.qcow2"
msgbox "Converting ${img}"
msg "Generating ${new}"
qemu-img convert -c -p -O qcow2 "${img}" "${new}" \
&& success "Done" \
|| error "Error: ${img} => ${new}"
done
exit $?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment