[libvirt] [PATCH 4/4] qemu: Improve error reporting from qemuDomainManagedSaveRemove
Eric Blake
eblake at redhat.com
Tue Dec 11 22:02:55 UTC 2012
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20121211/09dd29d8/attachment-0001.sig>
More information about the libvir-list
mailing list