live-block-ops.txt 1.8 KB

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