diff mbox

savevm: qemu_fille_buffer() used to return one error for reads of size 0.

Message ID 1319563138-21631-1-git-send-email-quintela@redhat.com
State New
Headers show

Commit Message

Juan Quintela Oct. 25, 2011, 5:18 p.m. UTC
Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 savevm.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Comments

Markus Armbruster Oct. 25, 2011, 5:46 p.m. UTC | #1
Juan Quintela <quintela@redhat.com> writes:

> Signed-off-by: Juan Quintela <quintela@redhat.com>
> ---
>  savevm.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/savevm.c b/savevm.c
> index f01838f..bee16c0 100644
> --- a/savevm.c
> +++ b/savevm.c
> @@ -476,6 +476,8 @@ static void qemu_fill_buffer(QEMUFile *f)
>      if (len > 0) {
>          f->buf_size += len;
>          f->buf_offset += len;
> +    } else if (len == 0) {
> +        f->last_error = -EIO;
>      } else if (len != -EAGAIN)
>          f->last_error = len;
>  }

This reverts an accidental change in commit dcd1d224 migration: change
has_error to contain errno values.

Reviewed-by: Markus Armbruster <armbru@redhat.com>
diff mbox

Patch

diff --git a/savevm.c b/savevm.c
index f01838f..bee16c0 100644
--- a/savevm.c
+++ b/savevm.c
@@ -476,6 +476,8 @@  static void qemu_fill_buffer(QEMUFile *f)
     if (len > 0) {
         f->buf_size += len;
         f->buf_offset += len;
+    } else if (len == 0) {
+        f->last_error = -EIO;
     } else if (len != -EAGAIN)
         f->last_error = len;
 }