]> xenbits.xensource.com Git - libvirt.git/commit
qemu: Do not override config XML in case of snapshot revert
authorMaxiwell S. Garcia <maxiwell@linux.ibm.com>
Tue, 30 Apr 2019 17:54:01 +0000 (14:54 -0300)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 20 May 2019 07:08:54 +0000 (09:08 +0200)
commitdfd70ca1ebc623fcda788c414a472107b37b2bb8
treea8b10085a5580c11c0302ff7535d1b70f9924116
parent6d3ac4f722dbbf8062afdbc1f47a26f9e59afc10
qemu: Do not override config XML in case of snapshot revert

Snapshot create operation saves the live XML and uses it to replace the
domain definition in case of revert. But the VM config XML is not saved
and the revert operation does not address this issue. This commit
prevents the config XML from being overridden by snapshot definition.

An active domain stores both current and new definitions. The current
definition (vm->def) stores the live XML and the new definition
(vm->newDef) stores the config XML. In an inactive domain, only the
config XML is persistent, and it's saved in vm->def.

The revert operation uses the virDomainObjAssignDef() to set the
snapshot definition in vm->newDef, if domain is active, or in vm->def
otherwise. But before that, it saves the old value to return to
caller. This return is used here to restore the config XML after
all snapshot startup process finish.

Signed-off-by: Maxiwell S. Garcia <maxiwell@linux.ibm.com>
src/qemu/qemu_driver.c