[libvirt] [PATCH 00/19] qemu: Add support for backups in combination with snapshots

Peter Krempa posted 19 patches 4 years, 3 months ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/cover.1576170715.git.pkrempa@redhat.com
docs/manpages/virsh.rst                       |  27 +-
src/qemu/qemu_backup.c                        | 145 ++-
src/qemu/qemu_backup.h                        |   7 +
src/qemu/qemu_block.c                         |  32 +
src/qemu/qemu_block.h                         |   5 +
src/qemu/qemu_checkpoint.c                    |   2 +-
src/qemu/qemu_driver.c                        |  84 +-
src/qemu/qemu_monitor.c                       |   6 +-
src/qemu/qemu_monitor.h                       |  18 +-
src/qemu/qemu_monitor_json.c                  |  96 +-
src/qemu/qemu_monitor_json.h                  |   6 +-
tests/qemublocktest.c                         | 241 +++++
.../backupmerge/basic-deep-out.json           |  22 +
.../backupmerge/basic-flat-out.json           |   6 +
.../backupmerge/basic-intermediate-out.json   |  10 +
.../backupmerge/snapshot-deep-out.json        |  38 +
.../backupmerge/snapshot-flat-out.json        |   6 +
.../snapshot-intermediate-out.json            |  14 +
tests/qemublocktestdata/bitmap/basic.json     | 117 +++
tests/qemublocktestdata/bitmap/basic.out      |   6 +
tests/qemublocktestdata/bitmap/snapshots.json | 836 ++++++++++++++++++
tests/qemublocktestdata/bitmap/snapshots.out  |  14 +
tests/qemublocktestdata/bitmap/synthetic.json | 118 +++
tests/qemublocktestdata/bitmap/synthetic.out  |   6 +
tests/qemumonitorjsontest.c                   |   2 +-
tools/virsh-domain.c                          |  76 +-
26 files changed, 1845 insertions(+), 95 deletions(-)
create mode 100644 tests/qemublocktestdata/backupmerge/basic-deep-out.json
create mode 100644 tests/qemublocktestdata/backupmerge/basic-flat-out.json
create mode 100644 tests/qemublocktestdata/backupmerge/basic-intermediate-out.json
create mode 100644 tests/qemublocktestdata/backupmerge/snapshot-deep-out.json
create mode 100644 tests/qemublocktestdata/backupmerge/snapshot-flat-out.json
create mode 100644 tests/qemublocktestdata/backupmerge/snapshot-intermediate-out.json
create mode 100644 tests/qemublocktestdata/bitmap/basic.json
create mode 100644 tests/qemublocktestdata/bitmap/basic.out
create mode 100644 tests/qemublocktestdata/bitmap/snapshots.json
create mode 100644 tests/qemublocktestdata/bitmap/snapshots.out
create mode 100644 tests/qemublocktestdata/bitmap/synthetic.json
create mode 100644 tests/qemublocktestdata/bitmap/synthetic.out
[libvirt] [PATCH 00/19] qemu: Add support for backups in combination with snapshots
Posted by Peter Krempa 4 years, 3 months ago
IMPORTANT:
This does NOT add support for merging the bitmaps during block jobs, so
manual deletion of snapshots will corrupt the incremental metadata!.

Allow combining snapshots and backups. During a snapshot we create a
bitmap for any active persistent bitmap to continue tracking the bitmaps
properly (as qemu doesn't support creating a dirty bitmap from the
allocation map). This also means that it works only for an active VM
since there also isn't a way to do it via qemu-img.

Thus a workaround is to start a VM as paused if this is required for
offline VMs.

We also now can merge bitmaps accross the backing chains.

You can fetch the changes at:

git fetch https://gitlab.com/pipo.sk/libvirt.git backup-snapshots

Peter Krempa (19):
  virsh: Add QMP command wrapping for 'qemu-monitor-command'
  virsh: Allow extracting 'return' section of QMP command in
    'qemu-monitor-command'
  qemu: monitor: Extract data about dirty-bimaps in
    qemuMonitorBlockGetNamedNodeData
  qemu: monitor: Extract internals of
    qemuMonitorJSONBlockGetNamedNodeData
  tests: qemublock: Add test for bitmap detection
  tests: qemublocktest: Add a syntetic test case for bitmap detection
  qemu: Check for explicit failure of qemuBlockSnapshotAddBlockdev
  qemu: snapshot: Fold formatting of snapshot transaction into prepare
    func
  qemu: monitor: Add 'granularity' parameter for block-dirty-bitmap-add
  qemu: snapshot: Propagate active bitmaps through external snapshots
  tests: qemublock: Add test case for detecting bitmaps as we create
    snapshots
  qemu: backup: Return 'def' instead  of 'obj' from
    qemuBackupBeginCollectIncrementalCheckpoints
  qemu: backup: Extract calculations of bitmaps to merge for incremental
    backup
  qemu: backup: Propagate bitmap metadata into
    qemuBackupDiskPrepareOneBitmapsChain
  qemu: backup: Export qemuBackupDiskPrepareOneBitmapsChain for tests
  tests: qemublock: Add testing of bitmap merging for incremental
    backups
  qemu: block: Introduce qemuBlockNamedNodeDataGetBitmapByName
  qemu: backup: Merge bitmaps accross the backing chain
  tests: qemublock: Add tests for cross-snapshot incremental backups

 docs/manpages/virsh.rst                       |  27 +-
 src/qemu/qemu_backup.c                        | 145 ++-
 src/qemu/qemu_backup.h                        |   7 +
 src/qemu/qemu_block.c                         |  32 +
 src/qemu/qemu_block.h                         |   5 +
 src/qemu/qemu_checkpoint.c                    |   2 +-
 src/qemu/qemu_driver.c                        |  84 +-
 src/qemu/qemu_monitor.c                       |   6 +-
 src/qemu/qemu_monitor.h                       |  18 +-
 src/qemu/qemu_monitor_json.c                  |  96 +-
 src/qemu/qemu_monitor_json.h                  |   6 +-
 tests/qemublocktest.c                         | 241 +++++
 .../backupmerge/basic-deep-out.json           |  22 +
 .../backupmerge/basic-flat-out.json           |   6 +
 .../backupmerge/basic-intermediate-out.json   |  10 +
 .../backupmerge/snapshot-deep-out.json        |  38 +
 .../backupmerge/snapshot-flat-out.json        |   6 +
 .../snapshot-intermediate-out.json            |  14 +
 tests/qemublocktestdata/bitmap/basic.json     | 117 +++
 tests/qemublocktestdata/bitmap/basic.out      |   6 +
 tests/qemublocktestdata/bitmap/snapshots.json | 836 ++++++++++++++++++
 tests/qemublocktestdata/bitmap/snapshots.out  |  14 +
 tests/qemublocktestdata/bitmap/synthetic.json | 118 +++
 tests/qemublocktestdata/bitmap/synthetic.out  |   6 +
 tests/qemumonitorjsontest.c                   |   2 +-
 tools/virsh-domain.c                          |  76 +-
 26 files changed, 1845 insertions(+), 95 deletions(-)
 create mode 100644 tests/qemublocktestdata/backupmerge/basic-deep-out.json
 create mode 100644 tests/qemublocktestdata/backupmerge/basic-flat-out.json
 create mode 100644 tests/qemublocktestdata/backupmerge/basic-intermediate-out.json
 create mode 100644 tests/qemublocktestdata/backupmerge/snapshot-deep-out.json
 create mode 100644 tests/qemublocktestdata/backupmerge/snapshot-flat-out.json
 create mode 100644 tests/qemublocktestdata/backupmerge/snapshot-intermediate-out.json
 create mode 100644 tests/qemublocktestdata/bitmap/basic.json
 create mode 100644 tests/qemublocktestdata/bitmap/basic.out
 create mode 100644 tests/qemublocktestdata/bitmap/snapshots.json
 create mode 100644 tests/qemublocktestdata/bitmap/snapshots.out
 create mode 100644 tests/qemublocktestdata/bitmap/synthetic.json
 create mode 100644 tests/qemublocktestdata/bitmap/synthetic.out

-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list