From 9c4097dfd827d3b647a9799f11b3a91daecc4f6a Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Tue, 4 Sep 2012 22:29:09 +0100 Subject: sparsify: Fix use of closed handle (thanks Olaf Hering). This fixes commit faaedeb3432253847107ca2c4530f681c6a1e385. Also contains an update to the test which tests the format auto-detect path. --- sparsify/sparsify.ml | 2 +- sparsify/test-virt-sparsify.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sparsify/sparsify.ml b/sparsify/sparsify.ml index fa729f36..50cbe178 100644 --- a/sparsify/sparsify.ml +++ b/sparsify/sparsify.ml @@ -351,7 +351,7 @@ let output_format = | Some fmt -> fmt (* user specified input format, use that *) | None -> (* Don't know, so we must autodetect. *) - match g#disk_format indisk with + match (new G.guestfs ())#disk_format indisk with | "unknown" -> error (f_"cannot detect input disk format; use the --format parameter") | fmt -> fmt diff --git a/sparsify/test-virt-sparsify.sh b/sparsify/test-virt-sparsify.sh index 02e98a5d..f85ac082 100755 --- a/sparsify/test-virt-sparsify.sh +++ b/sparsify/test-virt-sparsify.sh @@ -37,7 +37,7 @@ rm /boot/big umount-all EOF -$VG ./virt-sparsify --debug-gc --format raw test1.img --convert qcow2 test2.img +$VG ./virt-sparsify --debug-gc test1.img --convert qcow2 test2.img size_before=$(du -s test1.img | awk '{print $1}') size_after=$(du -s test2.img | awk '{print $1}') -- cgit