mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-11 07:17:44 +00:00
4201a7ea1c
Each <domainsnapshot> can now contain an optional <memory> element that describes how the VM state was handled, similar to disk snapshots. The new element will always appear in output; for back-compat, an input that lacks the element will assume 'no' or 'internal' according to the domain state. Along with this change, it is now possible to pass <disks> in the XML for an offline snapshot; this also needs to be wired up in a future patch, to make it possible to choose internal vs. external on a per-disk basis for each disk in an offline domain. At that point, using the --disk-only flag for an offline domain will be able to work. For some examples below, remember that qemu supports the following snapshot actions: qemu-img: offline external and internal disk savevm: online internal VM and disk migrate: online external VM transaction: online external disk ===== <domainsnapshot> <memory snapshot='no'/> ... </domainsnapshot> implies that there is no VM state saved (mandatory for offline and disk-only snapshots, not possible otherwise); using qemu-img for offline domains and transaction for online. ===== <domainsnapshot> <memory snapshot='internal'/> ... </domainsnapshot> state is saved inside one of the disks (as in qemu's 'savevm' system checkpoint implementation). If needed in the future, we can also add an attribute pointing out _which_ disk saved the internal state; maybe disk='vda'. ===== <domainsnapshot> <memory snapshot='external' file='/path/to/state'/> ... </domainsnapshot> This is not wired up yet, but future patches will allow this to control a combination of 'virsh save /path/to/state' plus disk snapshots from the same point in time. ===== So for 1.0.1 (and later, as needed), I plan to implement this table of combinations, with '*' designating new code and '+' designating existing code reached through new combinations of xml and/or the existing DISK_ONLY flag: domain memory disk disk-only | result ----------------------------------------- offline omit omit any | memory=no disk=int, via qemu-img offline no omit any |+memory=no disk=int, via qemu-img offline omit/no no any | invalid combination (nothing to snapshot) offline omit/no int any |+memory=no disk=int, via qemu-img offline omit/no ext any |*memory=no disk=ext, via qemu-img offline int/ext any any | invalid combination (no memory to save) online omit omit off | memory=int disk=int, via savevm online omit omit on | memory=no disk=default, via transaction online omit no/ext off | unsupported for now online omit no on | invalid combination (nothing to snapshot) online omit ext on | memory=no disk=ext, via transaction online omit int off |+memory=int disk=int, via savevm online omit int on | unsupported for now online no omit any |+memory=no disk=default, via transaction online no no any | invalid combination (nothing to snapshot) online no int any | unsupported for now online no ext any |+memory=no disk=ext, via transaction online int/ext any on | invalid combination (disk-only vs. memory) online int omit off |+memory=int disk=int, via savevm online int no/ext off | unsupported for now online int int off |+memory=int disk=int, via savevm online ext omit off |*memory=ext disk=default, via migrate+trans online ext no off |+memory=ext disk=no, via migrate online ext int off | unsupported for now online ext ext off |*memory=ext disk=ext, via migrate+transaction * docs/schemas/domainsnapshot.rng (memory): New RNG element. * docs/formatsnapshot.html.in: Document it. * src/conf/snapshot_conf.h (virDomainSnapshotDef): New fields. * src/conf/domain_conf.c (virDomainSnapshotDefFree) (virDomainSnapshotDefParseString, virDomainSnapshotDefFormat): Manage new fields. * tests/domainsnapshotxml2xmltest.c: New test. * tests/domainsnapshotxml2xmlin/*.xml: Update existing tests. * tests/domainsnapshotxml2xmlout/*.xml: Likewise. |
||
---|---|---|
.. | ||
capabilityschemadata | ||
commanddata | ||
confdata | ||
cputestdata | ||
domainschemadata | ||
domainsnapshotxml2xmlin | ||
domainsnapshotxml2xmlout | ||
interfaceschemadata | ||
lxcxml2xmldata | ||
networkxml2argvdata | ||
networkxml2xmlin | ||
networkxml2xmlout | ||
nodedevschemadata | ||
nodeinfodata | ||
nwfilterxml2xmlin | ||
nwfilterxml2xmlout | ||
qemuhelpdata | ||
qemuxml2argvdata | ||
qemuxml2xmloutdata | ||
qemuxmlnsdata | ||
sexpr2xmldata | ||
storagepoolxml2xmlin | ||
storagepoolxml2xmlout | ||
storagevolxml2xmlin | ||
storagevolxml2xmlout | ||
vmx2xmldata | ||
xencapsdata | ||
xmconfigdata | ||
xml2sexprdata | ||
xml2vmxdata | ||
.valgrind.supp | ||
capabilityschematest | ||
commandhelper.c | ||
commandtest.c | ||
conftest.c | ||
cpuset | ||
cputest.c | ||
define-dev-segfault | ||
domainschematest | ||
domainsnapshotschematest | ||
domainsnapshotxml2xmltest.c | ||
esxutilstest.c | ||
eventtest.c | ||
int-overflow | ||
interfaceschematest | ||
interfacexml2xmltest.c | ||
jsontest.c | ||
libvirtd-fail | ||
libvirtd-pool | ||
libvirtdconftest.c | ||
lxcxml2xmltest.c | ||
Makefile.am | ||
networkschematest | ||
networkxml2argvtest.c | ||
networkxml2xmltest.c | ||
nodedevschematest | ||
nodedevxml2xmltest.c | ||
nodeinfotest.c | ||
nwfilterschematest | ||
nwfilterxml2xmltest.c | ||
object-locking.ml | ||
oomtrace.pl | ||
openvzutilstest.c | ||
openvzutilstest.conf | ||
pkix_asn1_tab.c | ||
qemuargv2xmltest.c | ||
qemuhelptest.c | ||
qemumonitorjsontest.c | ||
qemumonitortest.c | ||
qemumonitortestutils.c | ||
qemumonitortestutils.h | ||
qemuxml2argvtest.c | ||
qemuxml2xmltest.c | ||
qemuxmlnstest.c | ||
read-bufsiz | ||
read-non-seekable | ||
reconnect.c | ||
schematestutils.sh | ||
seclabeltest.c | ||
securityselinuxhelper.c | ||
securityselinuxtest.c | ||
sexpr2xmltest.c | ||
shunloadhelper.c | ||
shunloadtest.c | ||
sockettest.c | ||
ssh.c | ||
start | ||
statstest.c | ||
storagebackendsheepdogtest.c | ||
storagepoolschematest | ||
storagepoolxml2xmltest.c | ||
storagevolschematest | ||
storagevolxml2xmltest.c | ||
test_conf.sh | ||
test-lib.sh | ||
testutils.c | ||
testutils.h | ||
testutilslxc.c | ||
testutilslxc.h | ||
testutilsqemu.c | ||
testutilsqemu.h | ||
testutilsxen.c | ||
testutilsxen.h | ||
utiltest.c | ||
vcpupin | ||
viratomictest.c | ||
virauthconfigtest.c | ||
virbitmaptest.c | ||
virbuftest.c | ||
virdrivermoduletest.c | ||
virhashdata.h | ||
virhashtest.c | ||
virkeyfiletest.c | ||
virlockspacetest.c | ||
virnetmessagetest.c | ||
virnetsockettest.c | ||
virnettlscontexttest.c | ||
virsh-all | ||
virsh-optparse | ||
virsh-schedinfo | ||
virsh-synopsis | ||
virsh-undefine | ||
virshtest.c | ||
virt-aa-helper-test | ||
virtimetest.c | ||
viruritest.c | ||
vmx2xmltest.c | ||
xencapstest.c | ||
xmconfigtest.c | ||
xml2sexprtest.c | ||
xml2vmxtest.c |