On 08/29/2013 05:20 AM, Max Reitz wrote: > Implement bdrv_amend_options for compat, size, backing_file, backing_fmt > and lazy_refcounts. > > Downgrading images from compat=1.1 to compat=0.10 is achieved through > handling all incompatible flags accordingly, clearing all compatible and > autoclear flags and expanding all zero clusters. > > Signed-off-by: Max Reitz <mre...@redhat.com> > ---
> +/* > + * Expands all zero clusters on the image; important for downgrading to a > qcow2 > + * version which doesn't yet support metadata zero clusters. Do we have to fully write 0 blocks into the image no matter what, or are there cases where, when the file has a backing image and we know the backing image has 0 bytes at the same offset, where we could flatten by removing the cluster and letting the reference defer to the backing file? It's always safer to write 0 blocks into this image, but it may be worth considering whether we need the (ability) to try the alternate method as it results in a smaller file and potentially faster conversion. > + > + /* the refcount order might be different in newer images - however, qemu > + * doesn't support anything different than 4 anyway, so nothing to fix > + * there */ This sounds risky. Wouldn't it be safer to error out if the image didn't have a refcount order of 4, than to just ignore it; on the grounds that if qemu DOES add support for non-4 refcount order, an error will at least alert someone to the fact that they need to add some (potentially complicated) code here? -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature