[PATCH v2 6/7] migration/ram: Fix ram_save_complete() return value

Akihiko Odaki <[email protected]>
Newsgroups org.kernel.vger.linux-edac,org.kernel.vger.kvm,org.nongnu.qemu-arm,org.nongnu.qemu-devel,org.nongnu.qemu-riscv
Message-ID <[email protected]>
ram_save_complete() and qemu_file_get_error_obj() are documented to
return negative values on error, but ram_save_complete() inverts the
sign of qemu_file_get_error_obj()'s return value. Remove the sign
inversion.

Signed-off-by: Akihiko Odaki <[email protected]>
---
 migration/ram.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/migration/ram.c b/migration/ram.c
index 6bc7f705d31a..e1c191ec4383 100644
--- a/migration/ram.c
+++ b/migration/ram.c
@@ -3431,7 +3431,7 @@ static int ram_save_complete(QEMUFile *f, void *opaque)
             int err = qemu_file_get_error_obj(f, &local_err);
 
             error_reportf_err(local_err, "Failed to write bitmap to file: ");
-            return -err;
+            return err;
         }
     }
 

-- 
2.54.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.