-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
On 29/09/2015 10:39, Kevin Wolf wrote: > bdrv_has_zero_init() takes care of that, in theory. The "problem" > here is that the target is opened with BDRV_O_NO_BACKING, so the > block layer doesn't consider this an image with a backing file. I think bdrv_has_zero_init() is working right. If you read the qcow2 file as it was opened (i.e. with BDRV_O_NO_BACKING), unallocated areas will indeed read as zeroes. Of course if the file is opened with BDRV_O_NO_BACKING but does have a backing file, you ought not to read unallocated areas at all. So it's not the answer (of bdrv_has_zero_init) that is wrong, but the question that was not well-specified. > Is there anything better than bs->backing_hd that we could check? It's simply sync == 'full', I think. Then the problematic case never even reaches bdrv_has_zero_init. Paolo -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJWCqRqAAoJEL/70l94x66DgcUH/jN8VFkGpZxXS5b+TnU8BeGV Xmr3AjqICYS4K1mKcuu20GKZO5QSTh4Z7p/Igo2KmiGqven2kT/NIvjPRlSv4tqZ Vov6AaamO6OIme+nA0hYbc3ANUY+b/7CqL8tDb3rKzah0FeFMSi1x7Who7aOCTQs IjsJ37/ay+mGmPR9akDAfqjJjGPBJFL9dxz/0pgdPDUyj7IwvyolgGZ49rGNzoHE /86Dy23ET16HQHDOz3afsrLHf9gxGZFCMsLJostqH0cuMs2sk1qnY9i9xEXYUM00 XNoaVafwCeH1ypXHNcP+GWtbbHBaMJJtmoRFB72VDRPq39XvpzWhifbKK3+c2Qw= =/2aT -----END PGP SIGNATURE-----