[Libguestfs] luks filter breaks zeroing

Richard W.M. Jones rjones at redhat.com
Fri Jun 10 12:01:34 UTC 2022


On Fri, Jun 10, 2022 at 06:47:44AM -0500, Eric Blake wrote:
> On Fri, Jun 10, 2022 at 09:40:48AM +0100, Richard W.M. Jones wrote:
> > 
> > (More of a note to self to investigate)
> > 
> > $ qemu-img create -f luks --object secret,data=LETMEPASS,id=sec0 -o key-secret=sec0 encrypted.img 100M
> > Formatting 'encrypted.img', fmt=luks size=104857600 key-secret=sec0
> > $ rm -f data.img
> > $ truncate -s 100M data.img
> > $ nbdkit file encrypted.img --filter=luks passphrase=LETMEPASS --run 'nbdcopy data.img $nbd'
> > nbdkit: backend.c:718: backend_zero: Assertion `c->can_zero > NBDKIT_ZERO_NONE' failed.
> > write at offset 0 failed: Transport endpoint is not connected
> > nbdkit: nbdkit command was killed by signal 6
> 
> It's a bug in server/backend.c:backend_zero() for not checking and
> handling ZERO_EMULATE by calling into pwrite instead.  I'll fix it
> shortly.  (I seem to recall that I had ZERO_EMULATE working when I
> first introduced it; I'll have to check git history and see if a
> refactoring accidentally lost it...)

I think so too (see patch I posted, which I withdraw).

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html


More information about the Libguestfs mailing list