libvirt/src/vz
Eric Blake f105627992 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>
2019-03-22 01:15:20 -05:00
..
Makefile.inc.am
vz_driver.c snapshot: Drop virDomainSnapshotDef.current 2019-03-22 01:15:20 -05:00
vz_driver.h Enforce a standard header file guard symbol name 2018-12-14 10:47:13 +00:00
vz_sdk.c lib: Use more of VIR_STEAL_PTR() 2019-01-28 14:46:58 +01:00
vz_sdk.h Enforce a standard header file guard symbol name 2018-12-14 10:47:13 +00:00
vz_utils.c conf: Rework/rename virDomainObjListFindByUUIDRef 2018-04-23 06:41:45 -04:00
vz_utils.h vz: build fix for virdomainsnapshotobjlist.h 2019-03-18 11:07:23 +03:00