[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [Qemu-devel] [PATCH v3] qemu-img: add skip option to dd
From: |
Fam Zheng |
Subject: |
Re: [Qemu-block] [Qemu-devel] [PATCH v3] qemu-img: add skip option to dd |
Date: |
Thu, 28 Jul 2016 17:08:55 +0800 |
User-agent: |
Mutt/1.6.1 (2016-04-27) |
On Wed, 07/27 16:51, Reda Sallahi wrote:
> +for skip in $TEST_SKIP_BLOCKS; do
> + echo
> + echo "== Creating image =="
> +
> + size=1M
> + _make_test_img $size
> + _check_test_img
> + $QEMU_IO -c "write -P 0xa 0 $size" "$TEST_IMG" | _filter_qemu_io
I think the data pattern could to be made less plain (i.e. add some variantion
based on the offset), to catch any misplacement bug in qemu-img dd (for example
off by one errors).
Fam
> +
> + echo
> + echo "== Converting the image with dd with skip=$skip =="
> +
> + $QEMU_IMG dd if="$TEST_IMG" of="$TEST_IMG.out" skip="$skip" -O "$IMGFMT"
> \
> + 2> /dev/null
> + $QEMU_IMG check "$TEST_IMG.out" -f "$IMGFMT" 2>&1 | _filter_testdir | \
> + _filter_qemu_img_check
> + dd if="$TEST_IMG" of="$TEST_IMG.out.dd" skip="$skip" status=none
> + echo
> + echo "== Compare the images with qemu-img compare =="
> +
> + $QEMU_IMG compare "$TEST_IMG.out.dd" "$TEST_IMG.out"
> +done