aboutsummaryrefslogtreecommitdiff
path: root/src/libxl
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2011-08-10 08:51:36 -0600
committerEric Blake <eblake@redhat.com>2011-08-10 21:50:02 -0600
commit0de75e855b0c37a7ef25370b19cabad34e679ce6 (patch)
tree1bb92d68ed33ae8b8b7a9ca2582b49c5e9c425c3 /src/libxl
parentdocs: describe new virtual switch configuration in network XML docs (diff)
downloadlibvirt-0de75e855b0c37a7ef25370b19cabad34e679ce6.tar.gz
libvirt-0de75e855b0c37a7ef25370b19cabad34e679ce6.tar.bz2
libvirt-0de75e855b0c37a7ef25370b19cabad34e679ce6.zip
managedsave: prohibit use on transient domains
Transient domains reject attempts to set autostart, and using virDomainCreate to restart a domain only works on persistent domains. Therefore, managed save makes no sense on transient domains, and should be rejected up front rather than creating an otherwise unrecoverable managed save file. Besides, transient domains imply that a lot more management is being done by the upper layer; this includes the assumption that the upper layer is okay managing the saved state file created by virDomainSave, and does not need to use managed save. * src/libvirt.c: Document that transient domains are incompatible with managed save. * src/qemu/qemu_driver.c (qemuDomainManagedSave): Enforce it. * src/libxl/libxl_driver.c (libxlDomainManagedSave): Likewise.
Diffstat (limited to 'src/libxl')
-rw-r--r--src/libxl/libxl_driver.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c
index 7cb362065..516148f74 100644
--- a/src/libxl/libxl_driver.c
+++ b/src/libxl/libxl_driver.c
@@ -2132,6 +2132,11 @@ libxlDomainManagedSave(virDomainPtr dom, unsigned int flags)
libxlError(VIR_ERR_OPERATION_INVALID, "%s", _("Domain is not running"));
goto cleanup;
}
+ if (!vm->persistent) {
+ libxlError(VIR_ERR_OPERATION_INVALID, "%s",
+ _("cannot do managed save for transient domain"));
+ goto cleanup;
+ }
name = libxlDomainManagedSavePath(driver, vm);
if (name == NULL)