On 7/8/20 6:32 AM, Richard W.M. Jones wrote:
On Tue, Jul 07, 2020 at 05:22:47PM -0500, Eric Blake wrote:
> This reverts commit 2c5aec42cf04c567639bd885cf12a57192229215.
>
> Now that we have an easy way to generate aligned extents from the
> plugin, where the client will never see an unaligned extent
> transition, it's time to put it to use.
>
> Signed-off-by: Eric Blake <eblake(a)redhat.com>
>
> ---
> Here's what I used on the command line; I need to turn it into a formal test:
>
> $ ./nbdkit -U - eval pread='exit 1' get_size='echo 8'
can_extents='exit 0' \
> extents='printf "0 3\n3 4 hole,zero\n7 1\n"' --run \
> 'qemu-img map -f raw --output=json $uri'
> $ ./nbdkit -U - --filter=swab eval pread='exit 1' get_size='echo 8'
can_extents='exit 0' extents='printf "0 3\n3 4 hole,zero\n7
1\n"' --run 'qemu-img map -f raw --output=json $uri'
The fact that I had to supply can_extents='exit 0' was another bug that
I just fixed in the eval plugin.
>
> except it's currently failing:
> nbdkit: eval[1]: error: swab: requests to this filter must be aligned
> nbdkit: backend.c:621: backend_extents: Assertion `*err' failed.
> qemu-img: Could not read file metadata: Input/output error
I would add -v to the command line, as it will show you exactly what
requests qemu-img is making. The assert failure seems to be a
separate and worrying problem.
Yes, the assert failure is a pre-existing bug in the swab filter, which
I just fixed: basically, filters MUST set *err when failing, so the
swab.c:is_aligned() helper needed an additional parameter.
But I hit the assert because of my bug in patch 2 of using a copy
instead of editing through a pointer, such that the client wasn't seeing
the edited aligned values after all. With that fixed, I'm now ready to
formalize the test, and push this patch and a similar one for the
blocksize filter.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization:
qemu.org |
libvirt.org