Patchwork [resend,2/3] savevm: fix wrong error set by ram_control_load_hook()

login
register
mail settings
Submitter Lei Li
Date Aug. 23, 2013, 1:30 p.m.
Message ID <1377264653-31031-2-git-send-email-lilei@linux.vnet.ibm.com>
Download mbox | patch
Permalink /patch/269454/
State New
Headers show

Comments

Lei Li - Aug. 23, 2013, 1:30 p.m.
It should set negative error value if there has been an error.

Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
---
 savevm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
mrhines@linux.vnet.ibm.com - Aug. 23, 2013, 2:18 p.m.
On 08/23/2013 09:30 AM, Lei Li wrote:
> It should set negative error value if there has been an error.
>
> Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
> ---
>   savevm.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/savevm.c b/savevm.c
> index 95a11f9..a0be109 100644
> --- a/savevm.c
> +++ b/savevm.c
> @@ -649,7 +649,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);
mrhines@linux.vnet.ibm.com - Aug. 23, 2013, 2:18 p.m.
On 08/23/2013 09:30 AM, Lei Li wrote:
> It should set negative error value if there has been an error.
>
> Signed-off-by: Lei Li <lilei@linux.vnet.ibm.com>
> ---
>   savevm.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/savevm.c b/savevm.c
> index 95a11f9..a0be109 100644
> --- a/savevm.c
> +++ b/savevm.c
> @@ -649,7 +649,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);

Reviewed-By: Michael R. Hines <mrhines@us.ibm.com>

Patch

diff --git a/savevm.c b/savevm.c
index 95a11f9..a0be109 100644
--- a/savevm.c
+++ b/savevm.c
@@ -649,7 +649,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);