qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] New option for snapshot_blkdev to avoid image creation


From: Kevin Wolf
Subject: Re: [Qemu-devel] New option for snapshot_blkdev to avoid image creation
Date: Tue, 11 Oct 2011 14:30:42 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0) Gecko/20110927 Thunderbird/7.0

Am 03.10.2011 18:09, schrieb Federico Simoncelli:
> In some situations might be useful to let qemu use an image that was
> prepared for a live snapshot.
> The advantage is that creating the snapshot file outside of the qemu
> process we can use the whole range of options provided by the format
> (eg for qcow2: encryption, cluster_size and preallocation).

In fact, I don't think encryption works, nor does preallocation work
with a backing file. I think you would have to check that the new image
file isn't encrypted, doesn't have any clusters allocated, etc.

I'm not sure that it makes sense to put the logic into an external
program (i.e. make it not available for users not using management
tools) when at the same you have to implement the same amount of checks
in qemu that verify that the management tool actually did what it is
supposed to.

> It is also possible to pre-set a relative path to the backing file
> (now it is created by default as absolute path).

Your code performs a literal string comparison with the old file name
used to open the image. So if it was relative on the qemu command line,
the backing file link must be relative as well, and if it was absolute
on the command line, it must be absolute.

> In the long run it can also avoid the danger of reimplementing qemu-img
> inside qemu (if we wanted to expose such options when a snapshot is
> requested).

This is not reimplementing, it is reusing.

bdrv_image_create() can do everything that qemu-img create can do.
qemu-img has only a thin wrapper around it. The only thing you need to
do is exposing the existing options in the monitor.

Kevin



reply via email to

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