From: Eric Blake <eblake@redhat.com>
To: Alex Bligh <alex@alex.org.uk>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] QCOW rebases on running VMs
Date: Wed, 27 Jan 2016 13:47:01 -0700 [thread overview]
Message-ID: <56A92CC5.9070403@redhat.com> (raw)
In-Reply-To: <CCBF57B7-04B8-47E9-8786-DB7DE786969B@alex.org.uk>
[-- Attachment #1: Type: text/plain, Size: 1525 bytes --]
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
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 604 bytes --]
next prev parent reply other threads:[~2016-01-27 20:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-27 18:04 [Qemu-devel] QCOW rebases on running VMs Alex Bligh
2016-01-27 19:01 ` Max Reitz
2016-01-27 20:47 ` Eric Blake [this message]
2016-01-28 12:36 ` Alex Bligh
2016-01-28 15:25 ` Eric Blake
2016-01-29 20:16 ` Alberto Garcia
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=56A92CC5.9070403@redhat.com \
--to=eblake@redhat.com \
--cc=alex@alex.org.uk \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).