Il 28/02/2012 16:47, Stefan Hajnoczi ha scritto: > At this stage we have dst/hd0snap1 opened with BDRV_O_NO_BACKING. If > it has no backing file and the guest issues a write request that is > smaller than a cluster in the image file, the untouched areas of that > cluster will be populated with zeroes. > > Once dst/hd0snap1 is reopened with dst/hd0base in place there will be > zeros in clusters where the guest wrote only a few sectors. We will > not "see" the backing file data in those clusters. > > Have you hit this problem or did I miss something?
I'm afraid not. Federico, perhaps you have to rewrite blkmirror to reuse copy-on-read mechanism. You can implement is_allocated and make the base image a real backing_file even though you can write to it. Perhaps some hack with BDRV_O_NO_BACKING, or perhaps it just works with Jeff's open-on-top behavior. Looks like it would also make streaming of the base image Just Work, at least to a non-raw destination. Remaining problems: 1) differentiating writes from copy-on-read and writes from the guest. This is needed to avoid spurious writes to the backing image each time you're doing a copy-on-read. 2) triggering a copy-on-read before writing partial clusters. Stefan, what do you think? Paolo