block: add bdrv_add_before_write_notifier()
authorStefan Hajnoczi <stefanha@redhat.com>
Mon, 24 Jun 2013 15:13:10 +0000 (17:13 +0200)
committerKevin Wolf <kwolf@redhat.com>
Fri, 28 Jun 2013 07:20:26 +0000 (09:20 +0200)
commitd616b224745b2c522f965cf8de7da17b553b959a
treedf5c6f5b8e13823d4c202782eec90c93b55997a6
parent5dae8e5fb803f53fadc116cefe353953b938cbe1
block: add bdrv_add_before_write_notifier()

The bdrv_add_before_write_notifier() function installs a callback that
is invoked before a write request is processed.  This will be used to
implement copy-on-write point-in-time snapshots where we need to copy
out old data before overwriting it.

Note that BdrvTrackedRequest is moved to block_int.h since it is passed
to .notify() functions.

Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c
include/block/block_int.h