From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39841) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOWzb-00008d-Py for qemu-devel@nongnu.org; Wed, 27 Jan 2016 15:47:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOWzZ-0000o1-3j for qemu-devel@nongnu.org; Wed, 27 Jan 2016 15:47:07 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55340) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOWzY-0000nS-Rj for qemu-devel@nongnu.org; Wed, 27 Jan 2016 15:47:05 -0500 References: From: Eric Blake Message-ID: <56A92CC5.9070403@redhat.com> Date: Wed, 27 Jan 2016 13:47:01 -0700 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6T29uUMslKe3e1op088gOVOqbcE7fUl1e" Subject: Re: [Qemu-devel] QCOW rebases on running VMs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alex Bligh , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --6T29uUMslKe3e1op088gOVOqbcE7fUl1e Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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. >=20 > Assume that we have the following structure: >=20 > QEMU -------> Writing disk > .... > backing disk N > .... > backing disk 1 > .... > backing disk 0 >=20 > If QEMU is not running, I can happily use 'qemu-img rebase' to merge ba= cking disks 1 ... N (i.e. so backing disk N is now based on backing disk = 0). >=20 > Is it safe to do this whilst the server is running using the writing di= sk which is based on backing disk N? Only through the running qemu. >=20 > 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) wi= ll still be present, QEMU will still keep an fd open for them, and it wil= l (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. >=20 > If not, do I need to use QMP magic instead? Yes. block-commit is your friend. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --6T29uUMslKe3e1op088gOVOqbcE7fUl1e Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJWqSzFAAoJEKeha0olJ0NqEikH/34BArSZrqgIfuNskMS2GxOk wM7pc5xDFPGYA8nHtJBVMiy8oCKlrHsGBp7HEUjIbpPFEHCtXDq3WwNu07C/IAvL S/entEQbX96DPJ9XNCVw46xI2np5Syi5hXYHPU+QkYHX4xpnhI0ZjpnYci314lti 98qNO93VsAk3EwLmYFsKZ2/TXxQkhPfuisxpfTa74wYVmBxfvrJvCI0h7nVZdmMp zR1X9hkfDUKO5TRtdeAwgE/jRuyKBbsy0JBu/FcwmAyf/FTCUuq2RGuaQpje17Og fZnRREHKUACWAt35EIBgGvGbn/fcuiTRDLSsmkg6tJLyx6wE588WvVeXgUB5ADo= =ORxq -----END PGP SIGNATURE----- --6T29uUMslKe3e1op088gOVOqbcE7fUl1e--