[Libguestfs] [PATCH v2v 3/3] lib/qemuNBD.ml: Use qemu-nbd --discard=unmap

Laszlo Ersek lersek at redhat.com
Thu Jan 20 12:34:43 UTC 2022


On 01/19/22 19:57, Richard W.M. Jones wrote:
> The default for qemu-nbd is to ignore discard requests.  This meant
> that for input files in qcow2 format the "Mapping ..."  (ie. fstrim)
> step did nothing, all the work was ignored and we copied deleted data
> over to the destination.
> 
> This was detected by the test-v2v-trim.sh test.
> 
> Fixes: commit 255722cbf39afc0b012e2ac00d16fa6ba2f8c21f
> ---
>  lib/qemuNBD.ml | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/lib/qemuNBD.ml b/lib/qemuNBD.ml
> index 89c93d7072..54139ce0b4 100644
> --- a/lib/qemuNBD.ml
> +++ b/lib/qemuNBD.ml
> @@ -93,6 +93,7 @@ let run_unix ?socket { disk; snapshot; format } =
>      ["qemu-nbd";
>       "-t";
>       "--shared=0";
> +     "--discard=unmap";
>       "--pid-file"; pidfile;
>       "--socket"; socket];
>  
> 

Reviewed-by: Laszlo Ersek <lersek at redhat.com>




More information about the Libguestfs mailing list