98d2c6f2cd
backup_start() creates a block job that copies a point-in-time snapshot of a block device to a target block device. We call backup_do_cow() for each write during backup. That function reads the original data from the block device before it gets overwritten. The data is then written to the target device. Currently backup cluster size is hardcoded to 65536 bytes. [I made a number of changes to Dietmar's original patch and folded them in to make code review easy. Here is the full list: * Drop BackupDumpFunc interface in favor of a target block device * Detect zero clusters with buffer_is_zero() and use bdrv_co_write_zeroes() * Use 0 delay instead of 1us, like other block jobs * Unify creation/start functions into backup_start() * Simplify cleanup, free bitmap in backup_run() instead of cb * function * Use HBitmap to avoid duplicating bitmap code * Use bdrv_getlength() instead of accessing ->total_sectors * directly * Delete the backup.h header file, it is no longer necessary * Move ./backup.c to block/backup.c * Remove #ifdefed out code * Coding style and whitespace cleanups * Use bdrv_add_before_write_notifier() instead of blockjob-specific hooks * Keep our own in-flight CowRequest list instead of using block.c tracked requests. This means a little code duplication but is much simpler than trying to share the tracked requests list and use the backup block size. * Add on_source_error and on_target_error error handling. * Use trace events instead of DPRINTF() -- stefanha] Signed-off-by: Dietmar Maurer <dietmar@proxmox.com> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
27 lines
912 B
Makefile
27 lines
912 B
Makefile
block-obj-y += raw.o cow.o qcow.o vdi.o vmdk.o cloop.o dmg.o bochs.o vpc.o vvfat.o
|
|
block-obj-y += qcow2.o qcow2-refcount.o qcow2-cluster.o qcow2-snapshot.o qcow2-cache.o
|
|
block-obj-y += qed.o qed-gencb.o qed-l2-cache.o qed-table.o qed-cluster.o
|
|
block-obj-y += qed-check.o
|
|
block-obj-y += vhdx.o
|
|
block-obj-y += parallels.o blkdebug.o blkverify.o
|
|
block-obj-y += snapshot.o qapi.o
|
|
block-obj-$(CONFIG_WIN32) += raw-win32.o win32-aio.o
|
|
block-obj-$(CONFIG_POSIX) += raw-posix.o
|
|
block-obj-$(CONFIG_LINUX_AIO) += linux-aio.o
|
|
|
|
ifeq ($(CONFIG_POSIX),y)
|
|
block-obj-y += nbd.o sheepdog.o
|
|
block-obj-$(CONFIG_LIBISCSI) += iscsi.o
|
|
block-obj-$(CONFIG_CURL) += curl.o
|
|
block-obj-$(CONFIG_RBD) += rbd.o
|
|
block-obj-$(CONFIG_GLUSTERFS) += gluster.o
|
|
block-obj-$(CONFIG_LIBSSH2) += ssh.o
|
|
endif
|
|
|
|
common-obj-y += stream.o
|
|
common-obj-y += commit.o
|
|
common-obj-y += mirror.o
|
|
common-obj-y += backup.o
|
|
|
|
$(obj)/curl.o: QEMU_CFLAGS+=$(CURL_CFLAGS)
|