[libvirt] [PATCH] Managed-Save: False warning on successful managed save restoration
Eric Blake
eblake at redhat.com
Wed May 28 14:43:40 UTC 2014
On 05/28/2014 02:45 AM, Peter Krempa wrote:
>> }
>
> But this patch isn't ideal and makes the logic in the code even more entangled.
> qemuDomainObjRestore returns 1 on corrupted image that was removed, 0 on sucess
> and -1 on other errors. The condition right above that hunk tests success case.
> We should connect this failure case condition to the else section of that
> condition so that we don't make it even weirder.
Your approach is even more legible; consider this a pre-approved ACK if
you turn it into a formal commit and apply it in time for 1.2.5.
>
> diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
> index c6f0b46..03b5a5e 100644
> --- a/src/qemu/qemu_driver.c
> +++ b/src/qemu/qemu_driver.c
> @@ -6080,14 +6080,14 @@ qemuDomainObjStart(virConnectPtr conn,
> VIR_WARN("Failed to remove the managed state %s", managed_save);
> else
> vm->hasManagedSave = false;
> - }
>
> - if (ret > 0) {
> - VIR_WARN("Ignoring incomplete managed state %s", managed_save);
> - } else {
> + goto cleanup;
> + } else if (ret < 0) {
> VIR_WARN("Unable to restore from managed state %s. "
> "Maybe the file is corrupted?", managed_save);
> goto cleanup;
> + } else {
> + VIR_WARN("Ignoring incomplete managed state %s", managed_save);
> }
> }
> }
>
>
> Peter
>
--
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: 604 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20140528/e5b3bf05/attachment-0001.sig>
More information about the libvir-list
mailing list