On 01/27/2016 11:04 AM, Alex Bligh wrote: > This question concerns the safety of rebases on backing disks whilst a VM is > running from a writing disk. > > Assume that we have the following structure: > > QEMU -------> Writing disk > .... > backing disk N > .... > backing disk 1 > .... > backing disk 0 > > If QEMU is not running, I can happily use 'qemu-img rebase' to merge backing > disks 1 ... N (i.e. so backing disk N is now based on backing disk 0). > > Is it safe to do this whilst the server is running using the writing disk > which is based on backing disk N?
Only through the running qemu. > > It is attractive to think it might be, as even if QEMU has a stale view of > the contents of backing disk N, backing disks N-1 to 1 (inclusive) will still > be present, QEMU will still keep an fd open for them, and it will (thus) > still be able to read the correct sectors from them. No. Any change to the backing chain in use by an active qemu process is liable to corrupt that file and/or qemu's view of the data to present to the guest. The only safe way to collapse a backing chain while qemu is running is via monitor (QMP or HMP) commands to that qemu process. > > If not, do I need to use QMP magic instead? Yes. block-commit is your friend. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature