From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37693) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMyLN-00012D-7A for qemu-devel@nongnu.org; Tue, 12 Jul 2016 10:07:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bMyLG-00050L-Uh for qemu-devel@nongnu.org; Tue, 12 Jul 2016 10:07:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:49398) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMyLG-000504-Mf for qemu-devel@nongnu.org; Tue, 12 Jul 2016 10:07:18 -0400 References: <4ba18341-3084-034c-a601-1ec216bc0558@imatronix.cl> From: Eric Blake Message-ID: <5784F994.5050402@redhat.com> Date: Tue, 12 Jul 2016 08:07:16 -0600 MIME-Version: 1.0 In-Reply-To: <4ba18341-3084-034c-a601-1ec216bc0558@imatronix.cl> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="J1SsTXIPNLItS7KGAkUkPjrUhVaXj0ie3" Subject: Re: [Qemu-devel] qemu-img convert of a backing qcow2 snapshot List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Christopher Pereira , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --J1SsTXIPNLItS7KGAkUkPjrUhVaXj0ie3 From: Eric Blake To: Christopher Pereira , qemu-devel@nongnu.org Message-ID: <5784F994.5050402@redhat.com> Subject: Re: [Qemu-devel] qemu-img convert of a backing qcow2 snapshot References: <4ba18341-3084-034c-a601-1ec216bc0558@imatronix.cl> In-Reply-To: <4ba18341-3084-034c-a601-1ec216bc0558@imatronix.cl> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 07/11/2016 09:42 PM, Christopher Pereira wrote: > Hi, >=20 > Let's say we have this chain: >=20 > base <--- sn1 <--- sn2 <--- active >=20 > Can we shutdown the VM and "qemu-img convert sn2 -O qcow2 sn2_new" and > rebase active to sn2_new like this: >=20 > sn2_new <--- active >=20 > ? Yes. As long as the guest-visible data in 'base <- sn1 <- sn2' is identical to the guest-visible data in 'sn2_new', then it doesn't matter which of the two files is used as the backing file for 'active'. >=20 > Or is it better practice to blockpull? BTW, is blockpull into an > non-active snapshot already supported and stable? There are patches proposed for blockpull into sn2, but those have not been committed yet. To pull data into sn2, you currently have to do offline work. However, you CAN commit from sn2 into base, creating the chain 'base+ <- active' (where 'base+' represents the data that used to be visible via 'base <- sn1 <- sn2') while the guest is live. >=20 > I have tested this qemu-img convert approach and it seems to work, but = I > would like to ask someone more familiar with qcow2 internals and preven= t > data corruption. Data corruption is likely to happen if you make external modifications to base, sn1, or sn2 while the guest is running, including 'qemu-img convert' modifications. If the guest is running, only QMP commands are safe. But if the guest is offline, then as long as the guest-visible contents are the same, you can rearrange backing chains however you see f= it. --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --J1SsTXIPNLItS7KGAkUkPjrUhVaXj0ie3 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/ iQEcBAEBCAAGBQJXhPmUAAoJEKeha0olJ0NqNOIIAIbsQbskD9f4RHeGRwKraKxp uatCyaHLsbM7CEcaiNh38F9sYqddjgt1nAhPKXZR0JtnvB/sLeHSFbJvBXvdZYcf U9qjJpVfOGOYUcS3eh4vTDYq07gaN9JRxPl8Q3LjvV+9bK2H/pYvAzW3GUKS+p4p 2uZkIqup8d1ynqsr/0zkKD7hEg93GjOzuzgyk55kInTC30bVOk8bospQzDb8vya/ 6k4LX6lezW3ZQF7+d5qOBLRoUCGcye3TFz0SaoCBiC7jAvtStCrk2HMbn1euE/4v Plcjv6igwHS3bzcuR8xNtS8lYEdgw0pbrvzZZVZx7meIemAxWVrL/Wb2jbLLpLQ= =KCWb -----END PGP SIGNATURE----- --J1SsTXIPNLItS7KGAkUkPjrUhVaXj0ie3--