]> git.proxmox.com Git - qemu.git/blame - docs/live-block-ops.txt
Open 2.0 development tree
[qemu.git] / docs / live-block-ops.txt
CommitLineData
094f1ba1
MT
1LIVE BLOCK OPERATIONS
2=====================
3
4High level description of live block operations. Note these are not
5supported for use with the raw format at the moment.
6
7Snapshot live merge
8===================
9
10Given a snapshot chain, described in this document in the following
11format:
12
13[A] -> [B] -> [C] -> [D]
14
15Where the rightmost object ([D] in the example) described is the current
16image which the guest OS has write access to. To the left of it is its base
17image, and so on accordingly until the leftmost image, which has no
18base.
19
20The snapshot live merge operation transforms such a chain into a
21smaller one with fewer elements, such as this transformation relative
22to the first example:
23
24[A] -> [D]
25
26Currently only forward merge with target being the active image is
27supported, that is, data copy is performed in the right direction with
28destination being the rightmost image.
29
30The operation is implemented in QEMU through image streaming facilities.
31
32The basic idea is to execute 'block_stream virtio0' while the guest is
33running. Progress can be monitored using 'info block-jobs'. When the
34streaming operation completes it raises a QMP event. 'block_stream'
35copies data from the backing file(s) into the active image. When finished,
36it adjusts the backing file pointer.
37
38The 'base' parameter specifies an image which data need not be streamed from.
39This image will be used as the backing file for the active image when the
40operation is finished.
41
42In the example above, the command would be:
43
44(qemu) block_stream virtio0 A
45
46
47Live block copy
48===============
49
50To copy an in use image to another destination in the filesystem, one
51should create a live snapshot in the desired destination, then stream
52into that image. Example:
53
54(qemu) snapshot_blkdev ide0-hd0 /new-path/disk.img qcow2
55
56(qemu) block_stream ide0-hd0
57
58