[libvirt] [PATCH] Managed-Save: False warning on successful managed save restoration

Eric Blake eblake at redhat.com
Tue May 27 23:28:33 UTC 2014


On 05/27/2014 05:24 PM, Eric Blake wrote:
> On 05/27/2014 08:06 AM, Jason J. Herne wrote:
>> From: "Jason J. Herne" <jjherne at us.ibm.com>
>>
>> qemuDomainObjStart is checking the return code from qemuDomainObjRestore for
>> errors even after determining that the return code is 0. This causes the
>> following error message to appear even when the restore was successful.
>>

> 
>> +                if (ret > 0) {
>> +                    VIR_WARN("Ignoring incomplete managed state %s", managed_save);
>> +                } else {
>> +                    VIR_WARN("Unable to restore from managed state %s. "
>> +                             "Maybe the file is corrupted?", managed_save);
>> +                }
>>              }
>> +            goto cleanup;
> 
> This goto is placed wrong; it causes us to skip starting the domain even
> when loading managed state was successful.

Actually, it looks like we WANT to goto cleanup for ret == 0, and that
the real problem is that commit cfc28c66 botched up for being noisy on
success. Maybe the fix we want is:

diff --git i/src/qemu/qemu_driver.c w/src/qemu/qemu_driver.c
index f008763..86190ff 100644
--- i/src/qemu/qemu_driver.c
+++ w/src/qemu/qemu_driver.c
@@ -6085,8 +6085,9 @@ qemuDomainObjStart(virConnectPtr conn,
             if (ret > 0) {
                 VIR_WARN("Ignoring incomplete managed state %s",
managed_save);
             } else {
-                VIR_WARN("Unable to restore from managed state %s. "
-                         "Maybe the file is corrupted?", managed_save);
+                if (ret < 0)
+                    VIR_WARN("Unable to restore from managed state %s. "
+                             "Maybe the file is corrupted?", managed_save);
                 goto cleanup;
             }
         }


-- 
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/20140527/3a7228fa/attachment-0001.sig>


More information about the libvir-list mailing list