4

In QEMU 5.1 zstd compression of your qcow2 files was introduced. But it's not described in the manual for qemu-img. How do you enable it?

MrCalvin
  • 659
  • 7
  • 22
  • Maybe this would be helpful : https://wiki.qemu.org/ChangeLog/5.1 It says Optional zstd compression for qcow2 (enable with compression_type=zstd as a creation option) – golder3 Apr 26 '21 at 07:31
  • Yea, I already found that. I don't really know what it means though. Is it an option to be used when you compiled QEMU yourself? All I can find is these patch solutions/threads. But that has been an option for years it seems, so why advertise it as a new feature in version 5.1.....what's new? – MrCalvin Apr 26 '21 at 19:50

2 Answers2

3

It seems to be an option for the qemu-img create command, so it's only possible to use zstd when creating new images e.g. qemu-img create -f qcow2 -o compression_type=zstd ./test-with-zstd.qcow2 10

I guess it provide continuous compression in contrast to the current "old" compression feature which didn't.

MrCalvin
  • 659
  • 7
  • 22
2

You can convert a zlib compressed qcow2 image to zstd compressed one like this

qemu-img convert -c -O qcow2 -o compression_type=zstd ./input-file-name.qcow2 ./output-file-name_c.qcow2

Tested this today in qemu-img version 7.0.0

L1Q
  • 21
  • 1