qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] The calculation of bytes_xfer in qemu_put_buffe


From: Orit Wasserman
Subject: Re: [Qemu-devel] [PATCH] The calculation of bytes_xfer in qemu_put_buffer() is wrong
Date: Wed, 20 Nov 2013 14:21:45 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.0

On 11/20/2013 01:26 PM, Juan Quintela wrote:
From: "Wangting (Kathy)" <address@hidden>

In qemu_put_buffer(), bytes_xfer += size is wrong, it will be more
than expected, and should be bytes_xfer += l.

Signed-off-by: zhangmin <address@hidden>
Signed-off-by: Juan Quintela <address@hidden>
---
  savevm.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/savevm.c b/savevm.c
index 2f631d4..3f912dd 100644
--- a/savevm.c
+++ b/savevm.c
@@ -794,7 +794,7 @@ void qemu_put_buffer(QEMUFile *f, const uint8_t *buf, int 
size)
          if (l > size)
              l = size;
          memcpy(f->buf + f->buf_index, buf, l);
-        f->bytes_xfer += size;
+        f->bytes_xfer += l;
          if (f->ops->writev_buffer) {
              add_to_iovec(f, f->buf + f->buf_index, l);
          }


Reviewed-by: Orit Wasserman <address@hidden>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]