[libvirt] [PATCH] qemu: managedsave: Don't spam logs with warnings about corrupted image

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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c index 2b852eb..7a29b82 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); } } } -- 1.9.3

On 05/28/2014 09:18 AM, Peter Krempa wrote:
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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
ACK. -- Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org

On 05/28/14 17:36, Eric Blake wrote:
On 05/28/2014 09:18 AM, Peter Krempa wrote:
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 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
ACK.
Pushed; Thanks. Peter
participants (2)
-
Eric Blake
-
Peter Krempa