于 2013-8-14 23:32, Kevin Wolf 写道:
Am 14.08.2013 um 16:26 hat Kaveh Razavi geschrieben:
On 08/14/2013 03:50 PM, Alex Bligh wrote:
Assuming the cache quota is not exhausted, how do you know how that
a VM has finished 'creating' the cache? At any point it might
read a bit more from the backing image.

I was assuming on shutdown.

Wait, so you're not really changing the cache while it's used, but you
only create it once and then use it like a regular backing file?  If so,
the only thing we need to talk about is the creation, because there's no
difference for using it.

Creation can use the existing copy-on-read functionality, and the only
thing you need additionally is a way to turn copy-on-read off at the
right point.

Or do I misunderstand what you're doing?

Kevin

  This cache capability seems have little to do with qcow2, but a
general block function: start/stop copy on read for one BS in a backing
chain. If so, suggest:
1 refine existing general copy on read code, not in qcow2.c but general
block code, make it able to start/stop copy on read for a BDS in the
chain.
2 add qmp interface for it.

Then the work flow will be:
step 1: prepare image, not related to qcow2 format.
qemu-img create cache.img -b base.img
qemu-img create vm1.img -b cache.img

step 2: boot vm1, vm2:
qemu -hda vm1.img -COR cache.img
qemu -hda vm2.img

--
Best Regards

Wenchao Xia


Reply via email to