]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: managedsave: Don't spam logs with warnings about corrupted image
authorPeter Krempa <pkrempa@redhat.com>
Wed, 28 May 2014 14:46:48 +0000 (16:46 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Wed, 28 May 2014 17:27:27 +0000 (19:27 +0200)
Even successful start of a VM from a managed save image would spam the
logs with the following message:

Unable to restore from managed state [path]. Maybe the file is
corrupted?

Re-arrange the logic to output the warning only when the image is
corrupted.

The flaw was introduced in commit cfc28c66.

src/qemu/qemu_driver.c

index a76309990dacf57aac3f40a0e5fd2310d816ab61..9becc0a1b404941e85b3b94d17ccb719882fc661 100644 (file)
@@ -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);
             }
         }
     }