aboutsummaryrefslogtreecommitdiff
path: root/block.h
diff options
context:
space:
mode:
authorlirans@il.ibm.com <lirans@il.ibm.com>2009-11-02 15:40:41 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2009-11-17 08:03:31 -0600
commit7cd1e32a860895ccca89eb90a0226efbcd969b55 (patch)
tree3b2c8712ea67b77d1a7a4b86a532744f9daa2aac /block.h
parent127338e6107c0763a56451cc8da489349a1e82f7 (diff)
Expose a mechanism to trace block writes
To support live migration without shared storage we need to be able to trace writes to disk while migrating. This Patch expose dirty block tracking per device to be polled from upper layer. Changes from v4: - Register dirty tracking for each block device. - Minor coding style issues. - Block.c will now manage a dirty bitmap per device once bdrv_set_dirty_tracking() is called. Bitmap is polled by the upper layer (block-migration.c). Signed-off-by: Liran Schour <lirans@il.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Diffstat (limited to 'block.h')
-rw-r--r--block.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/block.h b/block.h
index 6b0146f7cf..2d4f066906 100644
--- a/block.h
+++ b/block.h
@@ -80,7 +80,8 @@ void bdrv_register(BlockDriver *bdrv);
/* async block I/O */
typedef struct BlockDriverAIOCB BlockDriverAIOCB;
typedef void BlockDriverCompletionFunc(void *opaque, int ret);
-
+typedef void BlockDriverDirtyHandler(BlockDriverState *bs, int64_t sector,
+ int sector_num);
BlockDriverAIOCB *bdrv_aio_readv(BlockDriverState *bs, int64_t sector_num,
QEMUIOVector *iov, int nb_sectors,
BlockDriverCompletionFunc *cb, void *opaque);
@@ -187,4 +188,9 @@ int bdrv_save_vmstate(BlockDriverState *bs, const uint8_t *buf,
int bdrv_load_vmstate(BlockDriverState *bs, uint8_t *buf,
int64_t pos, int size);
+void bdrv_set_dirty_tracking(BlockDriverState *bs, int enable);
+int bdrv_get_dirty(BlockDriverState *bs, int64_t sector);
+void bdrv_reset_dirty(BlockDriverState *bs, int64_t cur_sector,
+ int nr_sectors);
+int bdrv_get_sectors_per_chunk(void);
#endif