While looking at my work on incremental backups, Nir raised a good point: if we want to recreate a set of known checkpoints on one machine that will be taking over a domain from another machine, my initial proposal required making multiple API calls to list the XML for each checkpoint on the source, and then more API calls to redefine each checkpoint on the destination; it also had the drawback that the list has to be presented in topological order (the API won't let you define a child checkpoint if the parent is not defined first). He asked if I could instead add bulk APIs, for getting the XML for all checkpoints at once, and then for redefining all checkpoints at once. Since my checkpoint code borrows heavily from concepts in the snapshot code, I chose to tackle the problem by starting with this series, which does the same thing for snapshots as what I plan to do for checkpoints. That is, since this patch series adds virDomainGetXMLDesc(, VIR_DOMAIN_XML_SNAPSHOTS) and virDomainSnapshotCreateXML(, VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE_LIST), the checkpoint series will add virDOmainGetXMLDesc(, VIR_DOMAIN_XML_CHECKPOINTS) and virDomainCheckpointCreateXML(, VIR_DOMAIN_CHECKPOINT_CREATE_REDEFINE_LIST) with very similar code. Also available at: https://repo.or.cz/libvirt/ericb.git/shortlog/refs/tags/snapshot-bulk-v2 Depends on: https://www.redhat.com/archives/libvir-list/2019-February/msg01263.html (virsh: Treat \n like ; in batch mode) https://www.redhat.com/archives/libvir-list/2019-February/msg01343.html (fix snapshot --redefine bugs) Since v1: Finish implementing the redefine code Split the patches slightly differently: all snapshot_conf code first, then just the public API changes, then virsh wrappers, then per-driver implementations for test and qemu. Rebase on top of bug fix and virsh feature addition found in the meantime. 001/11:[----] [--] 'domain: Document VIR_DOMAIN_XML_MIGRATABLE' 002/11:[----] [-C] 'snapshot: Give virDomainSnapshotDefFormat its own flags' 003/11:[0012] [FC] 'snapshot: Refactor virDomainSnapshotDefFormat' 004/11:[----] [-C] 'snapshot: Add virDomainSnapshotObjListFormat' 005/11:[----] [-C] 'domain: Expand virDomainDefFormatInternal with snapshots' 006/11:[down] 'snapshot: Add virDomainSnapshotDefParseList' 007/11:[0041] [FC] 'domain: Add VIR_DOMAIN_XML_SNAPSHOTS flag' 008/11:[0013] [FC] 'snapshot: Add VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE_LIST flag' 009/11:[down] 'virsh: Expose bulk snapshot dumpxml/redefine' 010/11:[down] 'test: Implement bulk snapshot operations' 011/11:[down] 'qemu: Implement bulk snapshot operations' Eric Blake (11): domain: Document VIR_DOMAIN_XML_MIGRATABLE snapshot: Give virDomainSnapshotDefFormat its own flags snapshot: Refactor virDomainSnapshotDefFormat snapshot: Add virDomainSnapshotObjListFormat domain: Expand virDomainDefFormatInternal with snapshots snapshot: Add virDomainSnapshotDefParseList domain: Add VIR_DOMAIN_XML_SNAPSHOTS flag snapshot: Add VIR_DOMAIN_SNAPSHOT_CREATE_REDEFINE_LIST flag virsh: Expose bulk snapshot dumpxml/redefine test: Implement bulk snapshot operations qemu: Implement bulk snapshot operations include/libvirt/libvirt-domain-snapshot.h | 3 + include/libvirt/libvirt-domain.h | 1 + src/conf/domain_conf.h | 8 + src/conf/snapshot_conf.h | 25 +- src/qemu/qemu_domain.h | 2 +- src/conf/domain_conf.c | 71 +++++- src/conf/snapshot_conf.c | 297 ++++++++++++++++++---- src/esx/esx_driver.c | 1 - src/libvirt-domain-snapshot.c | 21 +- src/libvirt-domain.c | 14 + src/libvirt_private.syms | 3 + src/network/bridge_driver.c | 3 +- src/qemu/qemu_domain.c | 36 ++- src/qemu/qemu_driver.c | 67 ++++- src/test/test_driver.c | 28 +- src/vbox/vbox_common.c | 5 +- src/vz/vz_driver.c | 3 +- tests/domainsnapshotxml2xmltest.c | 16 +- tools/virsh-domain.c | 7 + tools/virsh-snapshot.c | 14 + 20 files changed, 523 insertions(+), 102 deletions(-) -- 2.20.1 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list