[libvirt] changing compat when create volume from volume via libvirt api

I'm use via php binding https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolCreateXML... and see that image grows: image: new.qcow2 file format: qcow2 virtual size: 4.9G (5242880000 bytes) disk size: 854M cluster_size: 65536 Format specific information: compat: 0.10 refcount bits: 16 image: old.qcow2 file format: qcow2 virtual size: 4.9G (5242880000 bytes) disk size: 277M cluster_size: 65536 Format specific information: compat: 1.1 lazy refcounts: false refcount bits: 16 corrupt: false Why libvirt create new image with different compat? -- Vasiliy Tolstov, e-mail: v.tolstov@selfip.ru

2017-05-12 16:20 GMT+03:00 Vasiliy Tolstov <v.tolstov@selfip.ru>:
I'm use via php binding https://libvirt.org/html/libvirt-libvirt-storage.html#virStorageVolCreateXML...
and see that image grows:
image: new.qcow2 file format: qcow2 virtual size: 4.9G (5242880000 bytes) disk size: 854M cluster_size: 65536 Format specific information: compat: 0.10 refcount bits: 16
image: old.qcow2 file format: qcow2 virtual size: 4.9G (5242880000 bytes) disk size: 277M cluster_size: 65536 Format specific information: compat: 1.1 lazy refcounts: false refcount bits: 16 corrupt: false
Why libvirt create new image with different compat?
Also, specify compat in xml desc of new disk helps with comat version, but image size grows: image: new2.qcow2 file format: qcow2 virtual size: 4.9G (5242880000 bytes) disk size: 854M cluster_size: 65536 Format specific information: compat: 1.1 lazy refcounts: false refcount bits: 16 corrupt: false -- Vasiliy Tolstov, e-mail: v.tolstov@selfip.ru

2017-05-12 16:32 GMT+03:00 Vasiliy Tolstov <v.tolstov@selfip.ru>:
Also, specify compat in xml desc of new disk helps with comat version, but image size grows: image: new2.qcow2
Sorry for noise. I found root case - old.qcow2 have internal compression enabled when created qcow2 file, but on new image libvirt does not know about compression flag and not pass it to qemu-img binary. So qemu-img detect that original image have compression and new image does not have it and transparently decompress it. So this is "feature" of qemu-img and not bug in libvirt. -- Vasiliy Tolstov, e-mail: v.tolstov@selfip.ru
participants (1)
-
Vasiliy Tolstov