This is a subset of v10 of incremental backup, fixing Peter's review comments from v9 (and even some from v8 that I had missed earlier). There's still a lot more rebasing churn to resolve in the backup portion of the series before I can post a full backup-v10 label. There's still a decision to make: do we want this series in 5.6 (possibly with the addition of just patch 2/10 at [1] to introduce the backup API to make it possible for downstream to backport features without bumping .so)? This series has checkpoint support for test and qemu drivers, and I think is probably clean enough to finally satisfy everything Peter has been pointing out; but while the backup API itself seems reasonable, the qemu implementation will likely miss 5.6 (as that half of the v9 posting was further behind, and still has a lot of rebase churn to resolve). Or do we delay the checkpoint API to 5.7, to only go in with backup API? There's also still an outstanding question of whether the backup API needs a tweak to use 'const char *' instead of 'int' for the job identifier, given that Peter has a proposal for overhauling the representation of libvirt jobs. [1] https://www.redhat.com/archives/libvir-list/2019-July/msg00330.html Here's a comparison of these patches to v9: - rebase on top of master - use more VIR_AUTOFREE and friends (but probably still missed some spots where it would be worthwhile) - split several patches - add in a new patch to ensure the node names are learned at domain startup (but I didn't play enough with hotplug to see if that also has problems); necessary in order to... - get rid of detecting node names in checkpoint code - completely got rid of the notion of a current checkpoint in the public API (the internal code still has one, but solely to track which checkpoint becomes the parent of a new one to maintain a linear chain; when loading checkpoints on libvirtd restart, there should be at most one leaf node which becomes the internal current node) - improved code for handling partial checkpoints (the code now correctly handles: c1: disks A, B; c2: disks B, C; c3: disks A, B) 001/19:[down] 'snapshot: Don't leak moment obj list metaroot to callers' 002/19:[down] 'snapshot: Saner error message for duplicate create' 003/19:[down] 'snapshot: Documentation and comment improvements' 004/19:[down] 'backup: qemu: Detect node names at domain startup' 005/19:[0101] [FC] 'backup: Document new XML for checkpoints' 006/19:[0031] [FC] 'backup: Introduce virDomainCheckpoint APIs' 007/19:[0051] [FC] 'backup: Document nuances between different state capture APIs' 008/19:[0189] [FC] 'backup: Parse and output checkpoint XML' 009/19:[0066] [FC] 'backup: Allow for lists of checkpoint objects' 010/19:[----] [--] 'backup: Add new domain:checkpoint access control' 011/19:[----] [--] 'backup: Implement checkpoint APIs for remote driver' 012/19:[0161] [FC] 'backup: Implement virsh support for checkpoints' 013/19:[0047] [FC] 'backup: test: Implement metadata tracking for checkpoint APIs' 014/19:[0044] [FC] 'backup: Add virsh-checkpoints test' 015/19:[down] 'backup: qemu: Add directory for tracking checkpoints' 016/19:[0193] [FC] 'backup: qemu: Implement metadata tracking for checkpoint APIs' 017/19:[down] 'backup: qemu: Add helper API for looking up node name' 018/19:[0119] [FC] 'backup: Wire up qemu checkpoint commands over QMP' 019/19:[down] 'backup: Prevent snapshots and checkpoints at same time' Eric Blake (19): snapshot: Don't leak moment obj list metaroot to callers snapshot: Saner error message for duplicate create snapshot: Documentation and comment improvements backup: qemu: Detect node names at domain startup backup: Document new XML for checkpoints backup: Introduce virDomainCheckpoint APIs backup: Document nuances between different state capture APIs backup: Parse and output checkpoint XML backup: Allow for lists of checkpoint objects backup: Add new domain:checkpoint access control backup: Implement checkpoint APIs for remote driver backup: Implement virsh support for checkpoints backup: test: Implement metadata tracking for checkpoint APIs backup: Add virsh-checkpoints test backup: qemu: Add directory for tracking checkpoints backup: qemu: Implement metadata tracking for checkpoint APIs backup: qemu: Add helper API for looking up node name backup: Wire up qemu checkpoint commands over QMP backup: Prevent snapshots and checkpoints at same time include/libvirt/libvirt-domain-checkpoint.h | 137 ++ include/libvirt/libvirt-domain.h | 6 + include/libvirt/libvirt.h | 5 +- src/access/viraccessperm.h | 6 + src/conf/checkpoint_conf.h | 91 ++ src/conf/domain_conf.h | 2 + src/conf/virconftypes.h | 9 + src/conf/virdomaincheckpointobjlist.h | 72 + src/conf/virdomainmomentobjlist.h | 10 +- src/conf/virdomainobjlist.h | 7 +- src/conf/virdomainsnapshotobjlist.h | 2 + src/driver-hypervisor.h | 38 + src/qemu/qemu_conf.h | 2 + src/qemu/qemu_domain.h | 18 + tools/virsh-checkpoint.h | 26 + tools/virsh-completer.h | 4 + tools/virsh-util.h | 3 + tools/virsh.h | 1 + docs/Makefile.am | 3 + docs/apibuild.py | 2 + docs/docs.html.in | 4 +- docs/format.html.in | 1 + docs/formatcheckpoint.html.in | 196 +++ docs/formatsnapshot.html.in | 14 +- docs/index.html.in | 3 +- docs/kbase.html.in | 5 + docs/kbase/domainstatecapture.html.in | 303 +++++ docs/schemas/domaincheckpoint.rng | 94 ++ libvirt.spec.in | 2 + mingw-libvirt.spec.in | 4 + po/POTFILES | 3 + src/Makefile.am | 2 + src/access/viraccessperm.c | 3 +- src/conf/Makefile.inc.am | 4 + src/conf/checkpoint_conf.c | 597 +++++++++ src/conf/domain_conf.c | 6 + src/conf/virdomaincheckpointobjlist.c | 243 ++++ src/conf/virdomainmomentobjlist.c | 55 +- src/conf/virdomainobjlist.c | 11 + src/conf/virdomainsnapshotobjlist.c | 9 + src/libvirt-domain-checkpoint.c | 567 ++++++++ src/libvirt-domain.c | 19 +- src/libvirt_private.syms | 29 +- src/libvirt_public.syms | 16 + src/qemu/qemu_conf.c | 5 + src/qemu/qemu_domain.c | 190 +++ src/qemu/qemu_driver.c | 731 ++++++++++- src/qemu/qemu_process.c | 5 + src/remote/remote_daemon_dispatch.c | 20 + src/remote/remote_driver.c | 24 +- src/remote/remote_protocol.x | 123 +- src/remote_protocol-structs | 69 + src/rpc/gendispatch.pl | 32 +- src/test/test_driver.c | 386 +++++- tests/Makefile.am | 12 +- .../disk-default.xml | 7 + .../disk-invalid.xml | 8 + tests/qemudomaincheckpointxml2xmlin/empty.xml | 1 + .../name-invalid.xml | 4 + .../qemudomaincheckpointxml2xmlin/sample.xml | 7 + tests/qemudomaincheckpointxml2xmlin/size.xml | 4 + .../disk-default.xml | 11 + .../qemudomaincheckpointxml2xmlout/empty.xml | 7 + .../internal-active-invalid.xml | 53 + .../internal-inactive-invalid.xml | 53 + .../redefine.xml | 63 + .../qemudomaincheckpointxml2xmlout/sample.xml | 12 + tests/qemudomaincheckpointxml2xmlout/size.xml | 11 + tests/qemudomaincheckpointxml2xmltest.c | 213 +++ tests/virschematest.c | 2 + tests/virsh-checkpoint | 174 +++ tests/virsh-snapshot | 15 +- tools/Makefile.am | 1 + tools/virsh-checkpoint.c | 1153 +++++++++++++++++ tools/virsh-completer.c | 51 + tools/virsh-domain-monitor.c | 23 + tools/virsh-domain.c | 7 + tools/virsh-util.c | 11 + tools/virsh.c | 2 + tools/virsh.pod | 201 ++- 80 files changed, 6262 insertions(+), 63 deletions(-) create mode 100644 include/libvirt/libvirt-domain-checkpoint.h create mode 100644 src/conf/checkpoint_conf.h create mode 100644 src/conf/virdomaincheckpointobjlist.h create mode 100644 tools/virsh-checkpoint.h create mode 100644 docs/formatcheckpoint.html.in create mode 100644 docs/kbase/domainstatecapture.html.in create mode 100644 docs/schemas/domaincheckpoint.rng create mode 100644 src/conf/checkpoint_conf.c create mode 100644 src/conf/virdomaincheckpointobjlist.c create mode 100644 src/libvirt-domain-checkpoint.c create mode 100644 tests/qemudomaincheckpointxml2xmlin/disk-default.xml create mode 100644 tests/qemudomaincheckpointxml2xmlin/disk-invalid.xml create mode 100644 tests/qemudomaincheckpointxml2xmlin/empty.xml create mode 100644 tests/qemudomaincheckpointxml2xmlin/name-invalid.xml create mode 100644 tests/qemudomaincheckpointxml2xmlin/sample.xml create mode 100644 tests/qemudomaincheckpointxml2xmlin/size.xml create mode 100644 tests/qemudomaincheckpointxml2xmlout/disk-default.xml create mode 100644 tests/qemudomaincheckpointxml2xmlout/empty.xml create mode 100644 tests/qemudomaincheckpointxml2xmlout/internal-active-invalid.xml create mode 100644 tests/qemudomaincheckpointxml2xmlout/internal-inactive-invalid.xml create mode 100644 tests/qemudomaincheckpointxml2xmlout/redefine.xml create mode 100644 tests/qemudomaincheckpointxml2xmlout/sample.xml create mode 100644 tests/qemudomaincheckpointxml2xmlout/size.xml create mode 100644 tests/qemudomaincheckpointxml2xmltest.c create mode 100755 tests/virsh-checkpoint create mode 100644 tools/virsh-checkpoint.c -- 2.20.1 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list