[libvirt] [PATCH 2/2] snapshot: enforce REVERT_FORCE on qemu

Eric Blake eblake at redhat.com
Wed Oct 5 17:14:36 UTC 2011


On 10/04/2011 04:02 PM, Eric Blake wrote:
>>> * src/qemu/qemu_driver.c (qemuDomainRevertToSnapshot): Check for
>>> risky situations, and allow force to get past them.
>>
>> ACK.
>
> Before pushing this, I'm running some sanity tests. So far, this test
> sequence (adjusted to the fixed code) shows where force helps with older
> snapshots (I'll send separate email for showing how force helps active
> ABI-incompatible snapshots):

Test 3:
$ virsh define dom # domain with qcow2 disk
$ virsh snapshot-create-as dom snap
$ virsh edit dom # and add a second disk
$ virsh start dom
$ virsh snapshot-revert dom snap
# revert succeeds and domain is offline
$ virsh dumpxml dom # dom is back to one disk
$ virsh snapshot-revert dom snap --running
# revert succeeds, and dom boots
$ virsh shutdown dom # and wait for it to work
$ virsh edit dom # and add a second disk
$ virsh start dom
$ virt-manager # and open a window on the guest
$ virsh snapshot-revert dom snap --running
error: revert requires force: must respawn qemu to start inactive snapshot
# Error was expected
$ virsh snapshot-revert dom snap --running --force
# revert succeeds, and virt-manager display bounces
$ virsh dumpxml dom # dom is back to one disk

And now that I've covered all three cases where I used the new 
VIR_ERR_SNAPSHOT_REVERT_RISKY error code in qemu_driver.c, I'm 
comfortable enough with my testing to go ahead and push all three ACK'd 
patches.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org




More information about the libvir-list mailing list