qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Can qemu reopen image files?


From: Christopher Pereira
Subject: Re: [Qemu-devel] Can qemu reopen image files?
Date: Mon, 19 Dec 2016 12:03:41 -0300
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1

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 via email to

[Prev in Thread] Current Thread [Next in Thread]