[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 1/5] cpus: correct coding style in qmp_memsave/qm
From: |
Simon Ruderich |
Subject: |
[Qemu-devel] [PATCH v2 1/5] cpus: correct coding style in qmp_memsave/qmp_pmemsave |
Date: |
Thu, 12 Apr 2018 14:50:34 +0200 |
Signed-off-by: Simon Ruderich <address@hidden>
---
cpus.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/cpus.c b/cpus.c
index 38eba8bff3..c78f430532 100644
--- a/cpus.c
+++ b/cpus.c
@@ -2263,8 +2263,9 @@ void qmp_memsave(int64_t addr, int64_t size, const char
*filename,
while (size != 0) {
l = sizeof(buf);
- if (l > size)
+ if (l > size) {
l = size;
+ }
if (cpu_memory_rw_debug(cpu, addr, buf, l, 0) != 0) {
error_setg(errp, "Invalid addr 0x%016" PRIx64 "/size %" PRId64
" specified", orig_addr, orig_size);
@@ -2297,8 +2298,9 @@ void qmp_pmemsave(int64_t addr, int64_t size, const char
*filename,
while (size != 0) {
l = sizeof(buf);
- if (l > size)
+ if (l > size) {
l = size;
+ }
cpu_physical_memory_read(addr, buf, l);
if (fwrite(buf, 1, l, f) != l) {
error_setg(errp, QERR_IO_ERROR);
--
2.15.0
- [Qemu-devel] [PATCH] qmp: add pmemload command, Simon Ruderich, 2018/04/10
- [Qemu-devel] [PATCH v2 5/5] qmp: add pmemload command, Simon Ruderich, 2018/04/12
- Re: [Qemu-devel] [PATCH v2 5/5] qmp: add pmemload command, Eric Blake, 2018/04/17
- Re: [Qemu-devel] [PATCH v2 5/5] qmp: add pmemload command, Simon Ruderich, 2018/04/22
- Re: [Qemu-devel] [PATCH v2 5/5] qmp: add pmemload command, Eric Blake, 2018/04/23