]> git.ipfire.org Git - thirdparty/libvirt.git/commit
snapshot: add REVERT_FORCE to API
authorEric Blake <eblake@redhat.com>
Thu, 29 Sep 2011 23:52:06 +0000 (17:52 -0600)
committerEric Blake <eblake@redhat.com>
Wed, 5 Oct 2011 17:33:36 +0000 (11:33 -0600)
commit3c797404a520db95c12eaf4b83518ae5cb42d4e5
treeed0b19631d37b851f60df9203e90e09ecbf48bd4
parent869b69ea3dda89e05802c9f030c3655f2741ebe6
snapshot: add REVERT_FORCE to API

Although reverting to a snapshot is a form of data loss, this is
normally expected.  However, there are two cases where additional
surprises (failure to run the reverted state, or a break in
connectivity to the domain) can come into play.  Requiring extra
acknowledgment in these cases will make it less likely that
someone can get into an unrecoverable state due to a default revert.

Also create a new error code, so users can distinguish when forcing
would make a difference, rather than having to blindly request force.

* include/libvirt/libvirt.h.in (VIR_DOMAIN_SNAPSHOT_REVERT_FORCE):
New flag.
* src/libvirt.c (virDomainRevertToSnapshot): Document it.
* include/libvirt/virterror.h (VIR_ERR_SNAPSHOT_REVERT_RISKY): New
error value.
* src/util/virterror.c (virErrorMsg): Implement it.
* tools/virsh.c (cmdDomainSnapshotRevert): Add --force to virsh.
* tools/virsh.pod (snapshot-revert): Document it.
include/libvirt/libvirt.h.in
include/libvirt/virterror.h
src/libvirt.c
src/util/virterror.c
tools/virsh.c
tools/virsh.pod