[Libguestfs] Libguestfs Rsync-in with delta transfer enabled

Laszlo Ersek lersek at redhat.com
Mon Jun 20 10:37:27 UTC 2022


On 06/18/22 14:48, Ajay Nemade wrote:
> Hi,
> 
> I am exploring libguestfs rsync-in to copy the incremental changes to
> qcow2. I am following rsync example
> <https://rwmj.wordpress.com/2013/04/22/using-rsync-with-libguestfs/%20> to
> use the rsync-in. As per the example, I am using rsync daemon and
> rysnc-in is working for me. But, If the changes are in the same file
> then the complete file is getting transferred.
> 
> For example, if my file is of 100Mi then the first qcow2 is of approx
> 105Mi. After the first qcow2, I am appending data of 20Mi and then
> creating the second qcow2 using the first qcow2 as a backing file. Here
> then the second qcow2 should have been around approx 22Mi but it's
> showing 125Mi in qemu-img info.
> 
> From the above observation, I think the delta transfer algorithm is not
> getting used while doing rsync-in.
> 
> Just out of curiosity, I tried adding arg --no-whole-file in this
> function
> <https://github.com/libguestfs/libguestfs/blob/master/daemon/rsync.c#L40> but
> it's still not working.
> 
> Can anyone please point me to how to enable the delta transfer
> algorithm? Is it already supported ? or Do I need to make changes in the
> code? If yes, then please let me know the places where I should add the
> changes.

Please try to reproduce the symptom without libguestfs; that is, by
running rsync in the guest manually. If you can reproduce the symptom
like that, then please (a) paste the full output of "qemu-img info" from
the second (overlay) qcow2 file, (b) add "--stats" to the rsync command
in the guest, and paste the output from that too.

(The behavior you are reporting is not impossible in general IMO, just
unexpected when only appending data.)

Thanks
Laszlo


More information about the Libguestfs mailing list