]> xenbits.xensource.com Git - libvirt.git/commit
snapshot: Drop virDomainSnapshotDef.current
authorEric Blake <eblake@redhat.com>
Tue, 19 Mar 2019 03:56:19 +0000 (22:56 -0500)
committerEric Blake <eblake@redhat.com>
Fri, 22 Mar 2019 06:15:20 +0000 (01:15 -0500)
commitf105627992e2bfe5ff6a56d21f301e1252a24eb5
tree9eb333d87181c3cdb1597ba881ad9e6500929a9f
parent0baf6945ed3b548a97be81402ffb1439cfc5c4da
snapshot: Drop virDomainSnapshotDef.current

The only use for the 'current' member of virDomainSnapshotDef was with
the PARSE/FORMAT_INTERNAL flag for controlling an internal-use
<active> element marking whether a particular snapshot definition was
current, and even then, only by the qemu driver on output, and by qemu
and test driver on input. But this duplicates vm->snapshot_current,
and gets in the way of potential simplifications to have qemu store a
single file for all snapshots rather than one file per snapshot.  Get
rid of the member by adding a bool* parameter during parse (ignored if
the PARSE_INTERNAL flag is not set), and by adding a new flag during
format (if FORMAT_INTERNAL is set, the value printed in <active>
depends on the new FORMAT_CURRENT).

Then update the qemu driver accordingly, which involves hoisting
assignments to vm->current_snapshot to occur prior to any point where
a snapshot XML file is written (although qemu kept
vm->current_snapshot and snapshot->def_current in sync by the end of
the function, they were not always identical in the middle of
functions, so the shuffling gets a bit interesting). Later patches
will clean up some of that confusing churn to vm->current_snapshot.

Note: even if later patches refactor qemu to no longer use
FORMAT_INTERNAL for output (by storing bulk snapshot XML instead), we
will always need PARSE_INTERNAL for input (because on upgrade, a new
libvirt still has to parse XML left from a previous libvirt).

Signed-off-by: Eric Blake <eblake@redhat.com>
Reviewed-by: John Ferlan <jferlan@redhat.com>
src/conf/snapshot_conf.c
src/conf/snapshot_conf.h
src/conf/virdomainsnapshotobjlist.c
src/esx/esx_driver.c
src/qemu/qemu_domain.c
src/qemu/qemu_driver.c
src/test/test_driver.c
src/vbox/vbox_common.c
src/vz/vz_driver.c
tests/domainsnapshotxml2xmltest.c