All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Christopher Pereira <kripper@imatronix.cl>,
	Stefan Hajnoczi <stefanha@gmail.com>, Fam Zheng <famz@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] Can qemu reopen image files?
Date: Thu, 29 Dec 2016 07:55:23 -0600	[thread overview]
Message-ID: <b9e1b3fe-21ae-f9ef-5cb3-b6f4845b585c@redhat.com> (raw)
In-Reply-To: <91b93233-5ba7-cc9b-7ae5-ad07ce9b2885@redhat.com>

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

On 12/29/2016 07:52 AM, Eric Blake wrote:
> On 12/29/2016 07:42 AM, Eric Blake wrote:
>> On 12/28/2016 12:51 PM, Christopher Pereira wrote:
>>> Hi Eric,
>>>
>>> There is something I don't understand.
>>>
>>> We are doing: "virsh save", "qemu-img convert", "qemu-img rebase" and
>>> "virsh restore".
>>> We only touch the backing chain by doing the rebase while the VM is down.
>>> Is there any chance this procedure can destroy data?
>>
>> Since there are never two active writers to the file (you have made sure
>> that qemu-img and qemu are not both holding the same file open at once),
>> there is no chance for corruption on that front.  There's still a
>> possibility of corruption if you botch the instructions, and don't
>> rebuild the chain in such a way that the guest would see the same data,
>> but that's harder to say without seeing an actual transcript.
> 
> Oh, and since you mention virsh, that means you also have libvirt
> involved - anything you do to the backing chain with qemu-img is now
> behind libvirt's back, so you must also make sure that you are using
> 'virsh edit' if necessary to update the domain XML to match the changes
> you made to the backing chain.  Again, it's hard to say whether that is
> a factor in your case without an actual transcript (eventually, libvirt
> plans to track full backing chains even for offline domains; at the
> moment, however, it only tracks full backing chains for running domains
> and only the top-most image of an offline domain, which means qemu-img
> changes to intermediate parts of a backing chain don't affect offline
> domain XML now, but might in some future libvirt version).

And an addendum - ideally, libvirt will eventually expose enough
commands for doing image chain manipulation, so that you do it ALL
through virsh commands (whether the domain is running or offline),
rather than ever having to touch qemu-img yourself.  It may be that
libvirt will use qemu-img under the hood to do the same things you were
doing, but one of the goals of libvirt is to abstract away the need for
you to use more than one tool - it's just that in the particular case of
image backing chains, it is complex enough that libvirt has not yet
reached its ideal of being able to completely manage the backing chain
without you having to do external work.

-- 
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-12-29 13:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-18 23:52 [Qemu-devel] Can qemu reopen image files? Christopher Pereira
2016-12-19  1:07 ` Fam Zheng
2016-12-19 13:55   ` Stefan Hajnoczi
2016-12-19 15:03     ` Christopher Pereira
2016-12-19 15:48       ` Eric Blake
2016-12-19 16:24         ` Christopher Pereira
2016-12-28 18:51           ` Christopher Pereira
2016-12-29 13:42             ` Eric Blake
2016-12-29 13:52               ` Eric Blake
2016-12-29 13:55                 ` Eric Blake [this message]
2016-12-29 13:39           ` Eric Blake

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=b9e1b3fe-21ae-f9ef-5cb3-b6f4845b585c@redhat.com \
    --to=eblake@redhat.com \
    --cc=famz@redhat.com \
    --cc=kripper@imatronix.cl \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /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.