From 63785678f3941c84be01d3ab7867e2742ea9fe3e Mon Sep 17 00:00:00 2001 From: Pavel Dovgalyuk Date: Mon, 14 Mar 2016 10:45:10 +0300 Subject: replay: introduce block devices record/replay This patch introduces block driver that implement recording and replaying of block devices' operations. All block completion operations are added to the queue. Queue is flushed at checkpoints and information about processed requests is recorded to the log. In replay phase the queue is matched with events read from the log. Therefore block devices requests are processed deterministically. Signed-off-by: Pavel Dovgalyuk [ kwolf: Rebased onto modified and already applied part of the series ] Signed-off-by: Kevin Wolf --- docs/replay.txt | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'docs') diff --git a/docs/replay.txt b/docs/replay.txt index 3cedc25b2e..779c6c059e 100644 --- a/docs/replay.txt +++ b/docs/replay.txt @@ -175,3 +175,23 @@ Sometimes the block layer uses asynchronous callbacks for its internal purposes (like reading or writing VM snapshots or disk image cluster tables). In this case bottom halves are not marked as "replayable" and do not saved into the log. + +Block devices +------------- + +Block devices record/replay module intercepts calls of +bdrv coroutine functions at the top of block drivers stack. +To record and replay block operations the drive must be configured +as following: + -drive file=disk.qcow,if=none,id=img-direct + -drive driver=blkreplay,if=none,image=img-direct,id=img-blkreplay + -device ide-hd,drive=img-blkreplay + +blkreplay driver should be inserted between disk image and virtual driver +controller. Therefore all disk requests may be recorded and replayed. + +All block completion operations are added to the queue in the coroutines. +Queue is flushed at checkpoints and information about processed requests +is recorded to the log. In replay phase the queue is matched with +events read from the log. Therefore block devices requests are processed +deterministically. -- cgit v1.2.1