diff --git a/src/libvirt.c b/src/libvirt.c index c154c7d144..c8af3e1e81 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -15285,6 +15285,9 @@ error: * the saved state itself, and will reuse it once the domain is being * restarted (automatically or via an explicit libvirt call). * As a result any running domain is sure to not have a managed saved image. + * This also implies that managed save only works on persistent domains, + * since the domain must still exist in order to use virDomainCreate() to + * restart it. * * If @flags includes VIR_DOMAIN_SAVE_BYPASS_CACHE, then libvirt will * attempt to bypass the file system cache while creating the file, or diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index 7cb362065b..516148f740 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) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 0d6470da65..19e749f1eb 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -2582,6 +2582,11 @@ qemuDomainManagedSave(virDomainPtr dom, unsigned int flags) "%s", _("domain is not running")); goto cleanup; } + if (!vm->persistent) { + qemuReportError(VIR_ERR_OPERATION_INVALID, "%s", + _("cannot do managed save for transient domain")); + goto cleanup; + } name = qemuDomainManagedSavePath(driver, vm); if (name == NULL)