All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christopher Pereira <kripper@imatronix.cl>
To: 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: Mon, 19 Dec 2016 12:03:41 -0300	[thread overview]
Message-ID: <aee6f019-7d2f-5b4a-3679-35a909af6d6d@imatronix.cl> (raw)
In-Reply-To: <20161219135529.GE17374@stefanha-x1.localdomain>

Hi Fam, Stefan,

Thanks for answering.

We use "qemu-img convert" to convert a image in the middle of the chain, 
not the active one.
Those images (and the previous ones in the chain) are read-only and 
there should be no risk in converting them:

E.g.: for the following chain:

    base --> snap1 ---> snap2 ---> snap3 (active)

we do "qemu-img convert" on snap2 (readonly), generating a snap2' with 
the same content as snap2.

Then we do the rebase while the VM is suspended to make sure the image 
files are reopened.

Please confirm if I'm missing something here.

We are not using block-commit since we want to have more control (keep 
the base snapshot unmodified, use compression, etc).

Best regards,
Christopher

On 19-Dec-16 10:55, Stefan Hajnoczi wrote:
> On Mon, Dec 19, 2016 at 09:07:43AM +0800, Fam Zheng wrote:
>> On Sun, 12/18 20:52, Christopher Pereira wrote:
>>> Hi,
>>>
>>> We are doing a "qemu-img convert" operation (qcow2, with compression) to
>>> shorten the backing-chain (in the middle of the backing-chain).
>>> In order to force qemu to reopen files, we do a save and restore operation.
>>> Is there a faster way to reopen image files using virsh or qemu?
>> No, don't use qemu-img when the image is in use by QEMU. You want to use
>> "block-commit" command provided by QMP.
> It's worth being more explicit here:
>
> You will corrupt the image file if you access it with another program
> while QEMU is using it!
>
> Stefan

  reply	other threads:[~2016-12-19 15:03 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 [this message]
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
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=aee6f019-7d2f-5b4a-3679-35a909af6d6d@imatronix.cl \
    --to=kripper@imatronix.cl \
    --cc=famz@redhat.com \
    --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.