git://git.jankratochvil.net
/
nethome.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5e46f2a
)
+guestfish
author
lace
<>
Thu, 29 Apr 2010 10:02:25 +0000
(10:02 +0000)
committer
lace
<>
Thu, 29 Apr 2010 10:02:25 +0000
(10:02 +0000)
bin/qemu-img-recompress
patch
|
blob
|
history
diff --git
a/bin/qemu-img-recompress
b/bin/qemu-img-recompress
index
0feb535
..
18f9a47
100755
(executable)
--- a/
bin/qemu-img-recompress
+++ b/
bin/qemu-img-recompress
@@
-12,6
+12,8
@@
for file in "$@";do
set -xe
mv -i "$file" "$file"-src
rm -f "$file"-dest
+ test "$(guestfish -n -a "$file"-src run : list-devices : list-partitions|tr '\n' ' ')" = "/dev/vda /dev/vda1 "
+ guestfish -n -a "$file"-src run : zerofree /dev/vda1
time qemu-img convert -c -f qcow2 "$file"-src -O qcow2 "$file"-dest
mv -i "$file"-dest "$file"
rm -f "$file"-src