qemu: Improve error reporting from qemuDomainManagedSaveRemove

Report an error if unlink of the managedsave file fails.
This commit is contained in:
Peter Krempa 2012-12-11 19:34:16 +01:00
parent a02579141e
commit ed0bfd04f8

View File

@ -3337,8 +3337,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);