On 02/14/2016 03:02 AM, Fam Zheng wrote: > On Tue, 02/09 19:48, John Snow wrote: >> - Reading an entire drive to populate a bitmap with the understanding >> that an incremental backup is soon to follow is inefficient if the drive >> is more than just a little dirty: it may have been quicker to just >> create a new full backup and bitmap. > > Above all I think this is a good idea. Just as an alternative, can we add > another sync mode for drive-backup? > > (QMP) drive-backup device=d0 target=target.qcow2 format=qcow2 sync=diff \ > base=full-backup.qcow2 > > (the data of d0 will be compared against full-backup.qcow2 and only different > clusters will be copied to target.qcow2) > > Fam >
I like this idea too, since it has the chance to do a lot of things for us all at once. If we allow a user to pass a bitmap that we can synchronize to this backup, it will be one command that can do a few things all at once. Using the "bitmap-diff" approach [re-]establishes a bitmap, but still requires you to make the next backup. sync=diff just combines the two logical steps into one. There are two phases here: [Perform the diff] [Create a backup from that diff] backup mode=diff as suggested above performs both, block-dirty-bitmap-diff as suggested previously performs just the first action, while we already have commands to perform the second. I think arguably we'd only /need/ the bitmap-diff command, but I wouldn't personally mind having both for flexibility reasons (which historically don't fly too far on the qemu mailing list...) I think I will move ahead with prototyping the QMP command and see how far I get. If it's not too bad I'll send some code out for further debate. --js