Subject: [PATCH 34/46] savevm: fix wrong initialization by ram_control_load_hook

From: Nigel Croxon <[email-masked]>
Date: Thu, 14 Nov 2013 22:53:10 +0100

RH-Author: Nigel Croxon <[email-masked]>
Message-id: <[email-masked]>
Patchwork-id: 55720
O-Subject: [RHEL7.0 PATCH 34/42] savevm: fix wrong initialization by ram_control_load_hook
Bugzilla: 1011720
RH-Acked-by: Orit Wasserman <[email-masked]>
RH-Acked-by: Amit Shah <[email-masked]>
RH-Acked-by: Paolo Bonzini <[email-masked]>

Bugzilla: 1011720
https://bugzilla.redhat.com/show_bug.cgi?id=1011720

>From commit ID:
commit c77a5f2daa1ccbd825d59b95c70207c0a196bb94
Author: Lei Li <[email-masked]>
Date:   Wed Sep 4 17:02:35 2013 +0800

    savevm: fix wrong initialization by ram_control_load_hook

    It should set negative error value rather than 0 in QEMUFile
    if there has been an error.

    Reviewed-by: Michael R. Hines <[email-masked]>
    Signed-off-by: Lei Li <[email-masked]>
    Signed-off-by: Juan Quintela <[email-masked]>
---
 savevm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Signed-off-by: Michal Novotny <[email-masked]>
---
 savevm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/savevm.c b/savevm.c
index 03fc4d9..a0d4e09 100644
--- a/savevm.c
+++ b/savevm.c
@@ -642,7 +642,7 @@ void ram_control_after_iterate(QEMUFile *f, uint64_t flags)
 
 void ram_control_load_hook(QEMUFile *f, uint64_t flags)
 {
-    int ret = 0;
+    int ret = -EINVAL;
 
     if (f->ops->hook_ram_load) {
         ret = f->ops->hook_ram_load(f, f->opaque, flags);
-- 
1.7.11.7