qemu-e2k/include/block
Dietmar Maurer 98d2c6f2cd block: add basic backup support to block driver
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>
2013-06-28 09:20:26 +02:00
..
aio.h aio: add a ThreadPool instance to AioContext 2013-03-15 16:07:50 +01:00
block_int.h block: add basic backup support to block driver 2013-06-28 09:20:26 +02:00
block.h blkdebug: Add BLKDBG_FLUSH_TO_OS/DISK events 2013-06-06 11:27:22 +02:00
blockjob.h block: move include files to include/block/ 2012-12-19 08:31:31 +01:00
coroutine_int.h coroutine: stop using AioContext in CoQueue 2013-05-24 16:17:56 +02:00
coroutine.h rdma: export yield_until_fd_readable() 2013-06-27 02:38:36 +02:00
nbd.h nbd: support large NBD requests 2013-05-03 13:05:49 +02:00
qapi.h qmp: add ImageInfo in BlockDeviceInfo used by query-block 2013-06-07 13:37:45 +02:00
scsi.h hw: move headers to include/ 2013-04-08 18:13:10 +02:00
snapshot.h block: move snapshot code in block.c to block/snapshot.c 2013-06-04 13:56:30 +02:00
thread-pool.h threadpool: drop global thread pool 2013-03-15 16:07:51 +01:00