All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Christopher Pereira <kripper@imatronix.cl>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] qemu-img convert of a backing qcow2 snapshot
Date: Tue, 12 Jul 2016 08:07:16 -0600	[thread overview]
Message-ID: <5784F994.5050402@redhat.com> (raw)
In-Reply-To: <4ba18341-3084-034c-a601-1ec216bc0558@imatronix.cl>

[-- Attachment #1: Type: text/plain, Size: 1643 bytes --]

On 07/11/2016 09:42 PM, Christopher Pereira wrote:
> Hi,
> 
> Let's say we have this chain:
> 
>     base <--- sn1 <--- sn2 <--- active
> 
> Can we shutdown the VM and "qemu-img convert sn2 -O qcow2 sn2_new" and
> rebase active to sn2_new like this:
> 
>     sn2_new <--- active
> 
> ?

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'.

> 
> 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.

> 
> 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 prevent
> 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 fit.

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


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]

  reply	other threads:[~2016-07-12 14:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-12  3:42 [Qemu-devel] qemu-img convert of a backing qcow2 snapshot Christopher Pereira
2016-07-12 14:07 ` Eric Blake [this message]
2016-07-12 20:16   ` [Qemu-devel] qemu-img convert of a backing qcow2 snapshot (THANKS) Christopher Pereira

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5784F994.5050402@redhat.com \
    --to=eblake@redhat.com \
    --cc=kripper@imatronix.cl \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.