cryptospore / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

Blame SOURCES/kvm-The-calculation-of-bytes_xfer-in-qemu_put_buffer-is-.patch

0a122b
From a1b552f36a3257593125f054a83c467915c65dc4 Mon Sep 17 00:00:00 2001
0a122b
From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
0a122b
Date: Tue, 14 Jan 2014 15:27:11 -0500
0a122b
Subject: [PATCH 02/14] The calculation of bytes_xfer in qemu_put_buffer() is
0a122b
 wrong
0a122b
0a122b
Message-id: <1389713232-30999-2-git-send-email-dgilbert@redhat.com>
0a122b
Patchwork-id: 56697
0a122b
O-Subject: [RHEL-7.0 qemu-kvm PATCH 1/2] The calculation of bytes_xfer in qemu_put_buffer() is wrong
0a122b
Bugzilla: 1003467
0a122b
RH-Acked-by: Orit Wasserman <owasserm@redhat.com>
0a122b
RH-Acked-by: Paolo Bonzini <pbonzini@redhat.com>
0a122b
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
0a122b
0a122b
From: "Wangting (Kathy)" <kathy.wangting@huawei.com>
0a122b
0a122b
In qemu_put_buffer(), bytes_xfer += size is wrong, it will be more
0a122b
than expected, and should be bytes_xfer += l.
0a122b
0a122b
Signed-off-by: zhangmin <zhangmin6@huawei.com>
0a122b
Signed-off-by: Juan Quintela <quintela@redhat.com>
0a122b
(cherry picked from commit 8e86729a0e83b557c22808a2337252c969ca3986)
0a122b
---
0a122b
 savevm.c | 2 +-
0a122b
 1 file changed, 1 insertion(+), 1 deletion(-)
0a122b
0a122b
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
0a122b
---
0a122b
 savevm.c | 2 +-
0a122b
 1 file changed, 1 insertion(+), 1 deletion(-)
0a122b
0a122b
diff --git a/savevm.c b/savevm.c
0a122b
index a0d4e09..bd37959 100644
0a122b
--- a/savevm.c
0a122b
+++ b/savevm.c
0a122b
@@ -787,7 +787,7 @@ void qemu_put_buffer(QEMUFile *f, const uint8_t *buf, int size)
0a122b
         if (l > size)
0a122b
             l = size;
0a122b
         memcpy(f->buf + f->buf_index, buf, l);
0a122b
-        f->bytes_xfer += size;
0a122b
+        f->bytes_xfer += l;
0a122b
         if (f->ops->writev_buffer) {
0a122b
             add_to_iovec(f, f->buf + f->buf_index, l);
0a122b
         }
0a122b
-- 
0a122b
1.8.3.1
0a122b