Blob Blame History Raw
From 9933c07995dc978f8ea636cead7c66d78428484b Mon Sep 17 00:00:00 2001
Message-Id: <9933c07995dc978f8ea636cead7c66d78428484b.1387382496.git.minovotn@redhat.com>
In-Reply-To: <c5386144fbf09f628148101bc674e2421cdd16e3.1387382496.git.minovotn@redhat.com>
References: <c5386144fbf09f628148101bc674e2421cdd16e3.1387382496.git.minovotn@redhat.com>
From: Nigel Croxon <ncroxon@redhat.com>
Date: Thu, 14 Nov 2013 22:53:10 +0100
Subject: [PATCH 34/46] savevm: fix wrong initialization by
 ram_control_load_hook

RH-Author: Nigel Croxon <ncroxon@redhat.com>
Message-id: <1384469598-13137-35-git-send-email-ncroxon@redhat.com>
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 <owasserm@redhat.com>
RH-Acked-by: Amit Shah <amit.shah@redhat.com>
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>

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

>From commit ID:
commit c77a5f2daa1ccbd825d59b95c70207c0a196bb94
Author: Lei Li <lilei@linux.vnet.ibm.com>
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 <mrhines@us.ibm.com>
    Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
    Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 savevm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Signed-off-by: Michal Novotny <minovotn@redhat.com>
---
 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