[fedora-virt] Change format of backing file?

Eric Blake eblake at redhat.com
Wed Aug 13 02:57:32 UTC 2014


On 08/12/2014 05:59 PM, Tom Horsley wrote:
> Just curious here. Say I have a qcow2 image named outer.qcow2
> and it has a raw format backing_file named inner.img.
> 
> If I do something like
> 
> qemu-img convert -f raw -O qcow2 inner.img new-inner.img
> rm -f inner.img
> mv new-inner.img inner.img
> 
> (in other words convert the backing file from raw to
> qcow2)
> 
> What are the odds that outer.qcow2 will still be usable?

If you stop there, 0%.  The outer file is still trying to open the inner
file as raw, which sees completely different data than if it opened the
inner file as qcow2.

But if you follow that up with:

qemu-img rebase -u -b inner.img -F qcow2 -f qcow2 outer.qcow2

then it is 100% safe.  That is, as long as you rewrite the outer file to
track the new format of the inner file, then the guest-visible data is
identical.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 539 bytes
Desc: OpenPGP digital signature
URL: <http://lists.fedoraproject.org/pipermail/virt/attachments/20140812/8c97e3d0/attachment-0001.sig>


More information about the virt mailing list