On Mon, Apr 15, 2013 at 09:38:28AM -0600, Eric Blake wrote:
> On 04/15/2013 09:17 AM, Stefan Hajnoczi wrote:
> > Test that qemu-img convert -c works when input image length is not a
> > multiple of the cluster size.
> > 
> > Previously an error message would be produced:
> > 
> >   qemu-img: error while compressing sector 0: Input/output error
> > 
> > Now that qcow2 and qcow handle this case the test passes successfully.
> > 
> > Signed-off-by: Stefan Hajnoczi <stefa...@redhat.com>
> > ---
> 
> > +echo
> > +echo "== Creating single sector image =="
> > +
> > +_make_test_img 512
> > +$QEMU_IO -c "write -P0xa 0 512" $TEST_IMG | _filter_qemu_io
> > +mv $TEST_IMG $TEST_IMG.orig
> > +
> > +echo
> > +echo "== Converting the image, compressed =="
> > +
> > +$QEMU_IMG convert -c -O $IMGFMT $TEST_IMG.orig $TEST_IMG
> > +_check_test_img
> > +
> > +# success, all done
> 
> Is it worth also testing that qemu-img info on the converted image still
> reports that the guest sees a size of 512, to prove that the virtual
> size was not expanded as a result of compression tail padding?

Good point.  Let's beef up the test case.  We can also read the first
sector to verify to still contains 0xa bytes.

Stefan

Reply via email to