qemu: Do not override config XML in case of snapshot revert
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 <9e1524e90d3b98356dbf2c8ff6a781b1de473c4a@linux.ibm.com>

libvirt/libvirt,crobinso/libvirt,nertpinx/libvirt,olafhering/libvirt,crobinso/libvirt,olafhering/libvirt,eskultety/libvirt,eskultety/libvirt,andreabolognani/libvirt,libvirt/libvirt,fabianfreyer/libvirt,andreabolognani/libvirt,jardasgit/libvirt,zippy2/libvirt,libvirt/libvirt,olafhering/libvirt,nertpinx/libvirt,zippy2/libvirt,eskultety/libvirt,olafhering/libvirt,fabianfreyer/libvirt,eskultety/libvirt,jfehlig/libvirt,andreabolognani/libvirt,nertpinx/libvirt,jfehlig/libvirt,fabianfreyer/libvirt,libvirt/libvirt,andreabolognani/libvirt,jardasgit/libvirt,andreabolognani/libvirt,crobinso/libvirt,nertpinx/libvirt,jardasgit/libvirt,nertpinx/libvirt,jfehlig/libvirt,zippy2/libvirt,fabianfreyer/libvirt,fabianfreyer/libvirt,jfehlig/libvirt,jardasgit/libvirt,jardasgit/libvirt,crobinso/libvirt,zippy2/libvirt,eskultety/libvirt