
On 12/11/2012 11:48 AM, Peter Krempa wrote:
Report an error if unlink of the managedsave file fails. --- Hm, this patch changes semantics a little bit. If the unlink() fails now, the domain isn't marked as not having a managed save file. If somebody does not like this change I will return it to the previous semantics.
The new semantics make sense - another libvirtd restart will see the managedsave file still existing, and can attempt to reload/re-unlink it again. ACK as-is.
--- src/qemu/qemu_driver.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index b1cb185..1941ae7 100644 --- a/src/qemu/qemu_driver.c +++ b/src/qemu/qemu_driver.c @@ -3342,8 +3342,15 @@ qemuDomainManagedSaveRemove(virDomainPtr dom, unsigned int flags) if (!(name = qemuDomainManagedSavePath(driver, vm))) goto cleanup;
- ret = unlink(name); + if (unlink(name) < 0) { + virReportSystemError(errno, + _("Failed to remove managed save file '%s'"), + name); + goto cleanup; + } + vm->hasManagedSave = false; + ret = 0;
cleanup: VIR_FREE(name);
-- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org