]> xenbits.xensource.com Git - libvirt.git/commit
snapshot: track current snapshot across restarts
authorEric Blake <eblake@redhat.com>
Thu, 25 Aug 2011 21:11:03 +0000 (15:11 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 25 Aug 2011 21:11:03 +0000 (15:11 -0600)
commit6766ff10dd87752d7008f3218ad537371fec4b8d
tree0e4ac59a993d032aa3664498695b2d66421beeb7
parent5e47785b852d3ab3ecc962e25ffde06f6f715a49
snapshot: track current snapshot across restarts

Audit all changes to the qemu vm->current_snapshot, and make them
update the saved xml file for both the previous and the new
snapshot, so that there is always at most one snapshot with
<active>1</active> in the xml, and that snapshot is used as the
current snapshot even across libvirtd restarts.

This patch does not fix the case of virDomainSnapshotDelete(,CHILDREN)
where one of the children is the current snapshot; that will be later.

* src/conf/domain_conf.h (_virDomainSnapshotDef): Alter member
type and name.
* src/conf/domain_conf.c (virDomainSnapshotDefParseString)
(virDomainSnapshotDefFormat): Update clients.
* docs/schemas/domainsnapshot.rng: Tighten rng.
* src/qemu/qemu_driver.c (qemuDomainSnapshotLoad): Reload current
snapshot.
(qemuDomainSnapshotCreateXML, qemuDomainRevertToSnapshot)
(qemuDomainSnapshotDiscard): Track current snapshot.
docs/schemas/domainsnapshot.rng
src/conf/domain_conf.c
src/conf/domain_conf.h
src/qemu/qemu_driver.c