]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: Remove the managed state file only if restoring succeeded
authorOsier Yang <jyang@redhat.com>
Thu, 7 Apr 2011 08:58:26 +0000 (16:58 +0800)
committerOsier Yang <jyang@redhat.com>
Thu, 7 Apr 2011 08:58:26 +0000 (16:58 +0800)
commita73bbfc8be2a795e1adade9034c2197037720470
tree44ff2404372aa69c21835d4842d345dbb730b966
parenta4efb2e33560899b601d72d866dbfec3d0abf858
qemu: Remove the managed state file only if restoring succeeded

1) Both "qemuDomainStartWithFlags" and "qemuAutostartDomain" try to
restore the domain from managedsave'ed image if it exists (by
invoking "qemuDomainObjRestore"), but it unlinks the image even
if restoring fails, which causes data loss. (This problem exists
for "virsh managedsave dom; virsh start dom").

The fix for is to unlink the managed state file only if restoring
succeeded.

2) For "virsh save dom; virsh restore dom;", it can cause data
corruption if one reuse the saved state file for restoring. Add
doc to tell user about it.

3) In "qemuDomainObjStart", if "managed_save" is NULL, we shouldn't
fallback to start the domain, skipping it to cleanup as a incidental
fix. Discovered by Eric.
src/qemu/qemu_driver.c
tools/virsh.pod