History | View | Annotate | Download (18.7 kB)
block: Make BlockJobTypes const
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: mirror_complete(): use error_setg_file_open()
Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com>Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>Acked-by: Kevin Wolf <kwolf@redhat.com>
block: Add driver-specific options for backing files
Options starting in "backing." are passed to the backing file now. Ifyou don't need to specify the filename for the backing file, you can addit on the command line instead of in the image file:
$ qemu-nbd -t /tmp/test.img...
mirror: support more than one in-flight AIO operation
With AIO support in place, we can start copying more than one chunkin parallel. This patch introduces the required infrastructure forthis: the buffer is split into multiple granularity-sized chunks,...
mirror: support arbitrarily-sized iterations
Yet another optimization is to extend the mirroring iteration to include moreadjacent dirty blocks. This limits the number of I/O operations and makesmirroring efficient even with a small granularity. Most of the infrastructure...
mirror: do nothing on zero-sized disk
On a zero-sized disk we need to break out of the job successfullybefore bdrv_dirty_iter_init is called, otherwise you will get anassertion failure with the next patch.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>...
block: allow customizing the granularity of the dirty bitmap
Reviewed-by: Eric Blake <eblake@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
mirror: allow customizing the granularity
The desired granularity may be very different depending on the kind ofoperation (e.g. continuous replication vs. collapse-to-raw) and whetherthe VM is expected to perform lots of I/O while mirroring is in progress....
mirror: switch mirror_iteration to AIO
There is really no change in the behavior of the job here, sincethere is still a maximum of one in-flight I/O operation betweenthe source and the target. However, this patch already introducesthe AIO callbacks (which are unmodified in the next patch)...
mirror: add buf-size argument to drive-mirror
This makes sense when the next commit starts using the extra buffer spaceto perform many I/O operations asynchronously.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: implement dirty bitmap using HBitmap
This actually uses the dirty bitmap in the block layer, and convertsmirroring to use an HBitmapIter.
Reviewed-by: Laszlo Ersek <lersek@redhat.com> (except block/mirror.c parts)Reviewed-by: Eric Blake <eblake@redhat.com>...
mirror: perform COW if the cluster size is bigger than the granularity
When mirroring runs, the backing files for the target may not yet beready. However, this means that a copy-on-write operation on the targetwould fill the missing sectors with zeros. Copy-on-write only happens...
block: return count of dirty sectors, not chunks
Reviewed-by: Laszlo Ersek <lersek@redhat.com>Reviewed-by: Eric Blake <eblake@redhat.com>Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block: Fix how mirror_run() frees its buffer
It allocates with qemu_blockalign(), therefore it must free withqemu_vfree(), not g_free().
Signed-off-by: Markus Armbruster <armbru@redhat.com>Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
block: move include files to include/block/
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
aio: Get rid of qemu_aio_flush()
There are no remaining users, and new users should probably beusing bdrv_drain_all() in the first place.
mirror: implement completion
Switching to the target of the migration is done mostly asynchronously,and reported to management via the BLOCK_JOB_COMPLETED event; the onlysynchronous phase is opening the backing files. bdrv_open_backing_filecan always be done, even for migration of the full image (aka sync:...
mirror: add support for on-source-error/on-target-error
Error management is important for mirroring; otherwise, an error on thetarget (even something as "innocent" as ENOSPC) requires to start againwith a full copy. Similar to on_read_error/on_write_error, two separate...
mirror: introduce mirror job
This patch adds the implementation of a new job that mirrors a disk toa new image while letting the guest continue using the old image.The target is treated as a "black box" and data is copied from thesource to the target in the background. This can be used for several...